summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/textile.pm
blob: 208f295d2b16aeb37c4434253c46d48d66057222 (plain)
  1. #!/usr/bin/perl
  2. # By mazirian; GPL license
  3. # Textile markup
  4. package IkiWiki::Plugin::textile;
  5. use warnings;
  6. use strict;
  7. use IkiWiki 2.00;
  8. use Encode;
  9. sub import { #{{{
  10. hook(type => "htmlize", id => "txtl", call => \&htmlize);
  11. } # }}}
  12. sub htmlize (@) { #{{{
  13. my %params=@_;
  14. my $content = decode_utf8(encode_utf8($params{content}));
  15. eval q{use Text::Textile};
  16. return $content if $@;
  17. return Text::Textile::textile($content);
  18. } # }}}
  19. 1