Merge branch 'master' into tova
[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 use Encode;
11
12 sub import { #{{{
13         hook(type => "htmlize", id => "txtl", call => \&htmlize);
14 } # }}}
15
16 sub htmlize (@) { #{{{
17         my %params=@_;
18         my $content = decode_utf8(encode_utf8($params{content}));
19
20         eval q{use Text::Textile};
21         return $content if $@;
22         return Text::Textile::textile($content);
23 } # }}}
24
25 1