--Ryan Koppenhaver
## Original patch
-[[!tag patch]]
+[[!tag patch patch/core plugins/rst]]
<pre>
Index: debian/changelog
print html[html.find('<body>')+6:html.find('</body>')].strip();
";
- sub import { #{{{
+ sub import {
hook(type => "htmlize", id => "rst", call => \&htmlize);
+ hook(type => "htmlescape", id => "rst", call => \&htmlescape);
+ hook(type => "htmlescapelink", id => "rst", call => \&htmlescapelink);
- } # }}}
+ }
-+sub htmlescapelink ($$;@) { #{{{
++sub htmlescapelink ($$;@) {
+ my $url = shift;
+ my $text = shift;
+ my %params = @_;
+ else {
+ return "`$text <$url>`_";
+ }
-+} # }}}
++}
+
-+sub htmlescape ($) { #{{{
++sub htmlescape ($) {
+ my $html=shift;
+ $html=~s/^/ /mg;
+ return ".. raw:: html\n\n".$html;
-+} # }}}
++}
+
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $content=$params{content};
Index: doc/plugins/write.mdwn
-* reStructuredText does not allow raw html to be inserted into
- documents, but ikiwiki does so in many cases, including
- [[WikiLinks|ikiwiki/WikiLink]] and many
-- [[PreprocessorDirectives|ikiwiki/PreprocessorDirective]].
+- [[Directives|ikiwiki/Directive]].
+* Some bits of ikiwiki may still assume that markdown is used or embed html
+ in ways that break reStructuredText. (Report bugs if you find any.)
* It's slow; it forks a copy of python for each page. While there is a
+ return $hooks{htmlescapelink}{$type}{call}->($bestlink, $linktext);
+ }
return "<a href=\"$bestlink\">$linktext</a>";
- } #}}}
+ }
@@ -628,6 +640,14 @@
preview => $preprocess_preview,