Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / IkiWiki / Plugin / creole.pm
bloba1e4b31d326c7d5d9f2480be501a09c1f43e0bbb
1 #!/usr/bin/perl
2 # WikiCreole markup
3 # based on the WikiText plugin.
4 package IkiWiki::Plugin::creole;
6 use warnings;
7 use strict;
8 use IkiWiki 3.00;
10 sub import {
11 hook(type => "getsetup", id => "creole", call => \&getsetup);
12 hook(type => "htmlize", id => "creole", call => \&htmlize);
15 sub getsetup {
16 return
17 plugin => {
18 safe => 1,
19 rebuild => 1, # format plugin
20 section => "format",
24 sub htmlize (@) {
25 my %params=@_;
26 my $content = $params{content};
28 eval q{use Text::WikiCreole};
29 return $content if $@;
31 # don't parse WikiLinks, ikiwiki already does
32 creole_customlinks();
33 creole_custombarelinks();
35 return creole_parse($content);