1 Since some preprocessor directives insert raw HTML, it would be good to
2 specify, per-format, how to pass HTML so that it goes through the format
3 OK. With Markdown we cross our fingers; with reST we use the "raw"
6 I added an extra named parameter to the htmlize hook, which feels sort of
7 wrong, since none of the other hooks take parameters. Let me know what
11 diff -urX ignorepats clean-ikidev/IkiWiki/Plugin/mdwn.pm ikidev/IkiWiki/Plugin/mdwn.pm
12 --- clean-ikidev/IkiWiki/Plugin/mdwn.pm 2007-02-25 12:26:54.031200000 -0800
13 +++ ikidev/IkiWiki/Plugin/mdwn.pm 2007-02-27 21:26:43.556095000 -0800
18 - hook(type => "htmlize", id => "mdwn", call => \&htmlize);
19 + hook(type => "htmlize", id => "mdwn", call => \&htmlize, escape => \&escape);
22 +sub escape ($) { #{{{
28 diff -urX ignorepats clean-ikidev/IkiWiki/Plugin/rst.pm ikidev/IkiWiki/Plugin/rst.pm
29 --- clean-ikidev/IkiWiki/Plugin/rst.pm 2007-02-25 12:26:54.501830000 -0800
30 +++ ikidev/IkiWiki/Plugin/rst.pm 2007-02-27 22:44:11.040042000 -0800
32 html = publish_string(stdin.read(), writer_name='html',
33 settings_overrides = { 'halt_level': 6,
34 'file_insertion_enabled': 0,
38 print html[html.find('<body>')+6:html.find('</body>')].strip();
42 - hook(type => "htmlize", id => "rst", call => \&htmlize);
43 + hook(type => "htmlize", id => "rst", call => \&htmlize, escape => \&escape);
46 +sub escape ($) { #{{{
49 + return ".. raw:: html\n\n".$html;
52 sub htmlize (@) { #{{{
53 diff -urX ignorepats clean-ikidev/IkiWiki/Plugin/shortcut.pm ikidev/IkiWiki/Plugin/shortcut.pm
54 --- clean-ikidev/IkiWiki/Plugin/shortcut.pm 2007-02-25 12:26:54.538830000 -0800
55 +++ ikidev/IkiWiki/Plugin/shortcut.pm 2007-02-27 22:09:31.536088000 -0800
57 sub checkconfig () { #{{{
58 # Preprocess the shortcuts page to get all the available shortcuts
59 # defined before other pages are rendered.
60 + $pagesources{"shortcuts"} = "shortcuts.mdwn";
61 IkiWiki::preprocess("shortcuts", "shortcuts",
62 readfile(srcfile("shortcuts.mdwn")));
64 diff -urX ignorepats clean-ikidev/IkiWiki.pm ikidev/IkiWiki.pm
65 --- clean-ikidev/IkiWiki.pm 2007-02-25 12:26:58.812850000 -0800
66 +++ ikidev/IkiWiki.pm 2007-02-27 22:09:28.149568000 -0800
68 destpage => $destpage,
70 $preprocessing{$page}--;
71 + if ($ret =~ /[<>]/){
72 + my $type=pagetype($pagesources{$destpage});
73 + $ret = $hooks{htmlize}{$type}{escape}->(