ikiwiki/doc/bugs/rst_tweak.mdwn

53 lines
2.1 KiB
Plaintext
Raw Normal View History

rst.pm disallows raw HTML input. (It's meant as a security feature.)
IkiWiki generates HTML in rst files pretty much all the time. As
such, we should enable raw HTML support. --Ethan
2007-07-30 00:39:40 +02:00
> [[done]], although I did add a news item about it, since it could break
> the security of certian setups that don't use the htmlscrubber. --[[Joey]]
<pre>
Index: IkiWiki/Plugin/rst.pm
===================================================================
--- IkiWiki/Plugin/rst.pm (revision 3926)
+++ IkiWiki/Plugin/rst.pm (working copy)
@@ -30,7 +30,7 @@
html = publish_string(stdin.read(), writer_name='html',
settings_overrides = { 'halt_level': 6,
'file_insertion_enabled': 0,
- 'raw_enabled': 0 }
+ 'raw_enabled': 1 }
);
print html[html.find('<body>')+6:html.find('</body>')].strip();
";
2007-07-30 00:39:40 +02:00
</pre>
2008-10-11 16:43:01 +02:00
----
Does the Perl version of this plugin still exist? There appears to be no "rst.pm" in the current distribution; all there is is the python version. --Peter
2008-10-14 21:02:12 +02:00
> No, only the python version exists. It does have `raw_enabled` set.
> --[[Joey]]
2008-10-29 23:06:00 +01:00
I am sorry, but I am confused. Does this mean that I can use Ikiwiki
features that translate to HTML in rst files? For example, when I use a
\[[pagename]]-style link in a rst file, the page generated by Ikiwiki's rst
plugin says &lt;a href="./../pagename/">pagename&lt;/a> as text. The link
is expanded correctly, but the result isn't interpreted as HTML. Is that
what is supposed to happen? --Peter
> `raw_enabled` allows you to use the
> [raw directive](http://docutils.sourceforge.net/docs/ref/rst/directives.html),
> but this is not used by ikiwiki for wikilinks or anything else.
> That's why the [[plugin_page|plugins/rst]] has its note about
> issues with wikilinks and directives. You'd have to put those inside
> raw directives yourself to avoid rst escaping their result. --[[Joey]]
2009-09-17 22:44:33 +02:00
You can also create a raw "role" which is at least easier than raw directives.
.. role:: ikiwiki(raw)
:format: html
:ikiwiki:`\[[WikiLink]]`
A role assigns meaning to interpreted text (for example :acronym:`ABC`) or :PEP:`8`. --ulrik [kaizer.se]