summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/wikitext.pm
blob: e1d346ae67d19962fc732759e540c17776d8f2a6 (plain)
  1. #!/usr/bin/perl
  2. # WikiText markup
  3. package IkiWiki::Plugin::wikitext;
  4. use warnings;
  5. use strict;
  6. use IkiWiki 2.00;
  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