~rjpcasalino/bss

7ee50daed75fec38a3bceb6a62e62b42bbc045a8 — rjpc 5 months ago 5b32fb9
adds simple markdown filter for tt
1 files changed, 22 insertions(+), 0 deletions(-)

A lib/Markdown.pm
A lib/Markdown.pm => lib/Markdown.pm +22 -0
@@ 0,0 1,22 @@
#$Id: Markdown.pm,v 1.3 2005/11/12 03:28:09 naoya Exp $
package Template::Plugin::Markdown;
use strict;
use base qw (Template::Plugin::Filter);
use Text::Markdown;
 
our $VERSION = 0.02;
 
sub init {
    my $self = shift;
    $self->{_DYNAMIC} = 1;
    $self->install_filter($self->{_ARGS}->[0] || 'markdown');
    $self;
}
 
sub filter {
    my ($self, $text, $args, $config) = @_;
    my $m = Text::Markdown->new;
    return $m->markdown($text);
}
 
1;