summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/wikitext.pm
blob: 586be087415f23df6ea5dc66e2395d29483c5b3c (plain)
  1. #!/usr/bin/perl
  2. # WikiText markup
  3. package IkiWiki::Plugin::wikitext;
  4. use warnings;
  5. use strict;
  6. use IkiWiki;
  7. sub import { #{{{
  8. hook(type => "htmlize", id => "wiki", call => \&htmlize);
  9. } # }}}
  10. sub htmlize (@) { #{{{
  11. my %params=@_;
  12. my $content = $params{content};
  13. eval q{use Text::WikiFormat};
  14. return $content if $@;
  15. return Text::WikiFormat::format($content, undef, { implicit_links => 0 });
  16. } # }}}
  17. 1