Rubric::Entry::Formatter::Nil - format entries by formatting nearly not at all


Rubric documentation Contained in the Rubric distribution.

Index


Code Index:

NAME

Top

Rubric::Entry::Formatter::Nil - format entries by formatting nearly not at all

VERSION

Top

version 0.147

DESCRIPTION

Top

This is the default formatter. The only formatting it performs is done by Template::Filters' html_para filter. Paragraph breaks will be retained from plaintext into HTML, but nothing else will be done.

METHODS

Top

TODO

Top

AUTHOR

Top

Ricardo SIGNES, <rjbs@cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-rubric@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT

Top


Rubric documentation Contained in the Rubric distribution.
use strict;
use warnings;
package Rubric::Entry::Formatter::Nil;
our $VERSION = '0.147';

use Template::Filters;

my $filter = Template::Filters->new->fetch('html_para');

sub as_html {
  my ($class, $arg) = @_;
  return '' unless $arg->{text};
  return $filter->($arg->{text});
}

sub as_text {
  my ($class, $arg) = @_;
  return '' unless $arg->{text};
  return $arg->{text};
}

1;