summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/creole.pm
blob: a259f49ebe386225f982ac30e04d0c3eb5c73015 (plain)
  1. #!/usr/bin/perl
  2. # WikiCreole markup
  3. # based on the WikiText plugin.
  4. package IkiWiki::Plugin::creole;
  5. use warnings;
  6. use strict;
  7. use IkiWiki 2.00;
  8. sub import { #{{{
  9. hook(type => "htmlize", id => "creole", call => \&htmlize);
  10. } # }}}
  11. sub htmlize (@) { #{{{
  12. my %params=@_;
  13. my $content = $params{content};
  14. eval q{use Text::WikiCreole};
  15. return $content if $@;
  16. # don't parse WikiLinks, ikiwiki already does
  17. creole_link(sub { return shift });
  18. creole_customlinks();
  19. return creole_parse($content);
  20. } # }}}
  21. 1