~rjpcasalino/bss

4da98ef299f0d44dd770f8b2bb5941927bada661 — rjpc 5 months ago e379c86
gives credit to naoya
1 files changed, 7 insertions(+), 8 deletions(-)

M lib/Markdown.pm
M lib/Markdown.pm => lib/Markdown.pm +7 -8
@@ 1,23 1,22 @@
# TODO:
# give credit to OG author
# This is mostly Markdown.pm,v 1.3 2005/11/12 03:28:09 by naoya
# see: https://metacpan.org/release/NAOYA/Template-Plugin-Markdown-0.02
package Markdown;

use strict;
use base qw (Template::Plugin::Filter);
use Text::Markdown;
 
our $VERSION = 0.02;
 
use base qw (Template::Plugin::Filter);

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;