]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/wikitext.pm
Remember to run all the tests before committing!
[git.ikiwiki.info.git] / IkiWiki / Plugin / wikitext.pm
1 #!/usr/bin/perl
2 # WikiText markup
3 package IkiWiki::Plugin::wikitext;
5 use warnings;
6 use strict;
7 use IkiWiki 3.00;
9 sub import {
10         hook(type => "getsetup", id => "wiki", call => \&getsetup);
11         hook(type => "htmlize", id => "wiki", call => \&htmlize);
12 }
14 sub getsetup () {
15         return
16                 plugin => {
17                         safe => 0, # format plugin
18                         rebuild => undef,
19                         section => "format",
20                 },
21 }
24 sub htmlize (@) {
25         my %params=@_;
26         my $content = $params{content};
28         eval q{use Text::WikiFormat};
29         return $content if $@;
30         return Text::WikiFormat::format($content, undef, { implicit_links => 0 });
31 }
33 1