Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info
[ikiwiki] / IkiWiki / Plugin / textile.pm
1 #!/usr/bin/perl
2 # By mazirian; GPL license
3 # Textile markup
4
5 package IkiWiki::Plugin::textile;
6
7 use warnings;
8 use strict;
9 use IkiWiki 2.00;
10
11 sub import { #{{{
12         hook(type => "htmlize", id => "txtl", call => \&htmlize);
13 } # }}}
14
15 sub htmlize (@) { #{{{
16         my %params=@_;
17         my $content = $params{content};
18
19         eval q{use Text::Textile};
20         return $content if $@;
21         return Text::Textile::textile($content);
22 } # }}}
23
24 1