The necessary patch is already included in Zwiki (> 0.53).

The raw directive in reStructuredText was disabled by default in recent versions of docutils (security concerns). See the updated example below, for using a raw-derived role that works. (see the source of this page for the exact details)

(new) question about dtml interpretation in rst --Simon Michael, Tue, 07 Sep 2004 10:13:20 -0700 reply

stefan rank wrote:

i was wondering why there is no dtml processing for rst? For me the following patch:

[enable dtml interpretation in rst pagetype
stefan(DOT)rank(AT)oefai(DOT)at**20040907081416] {
hunk ./pagetypes/rst.py 23
+    supportsDtml = yes
hunk ./pagetypes/rst.py 43
-        t = page.preRendered()
+        if page.dtmlAllowed():
+            t = page.evaluatePreRenderedAsDtml(page,REQUEST,RESPONSE,**kw)
+        else:
+            t = page.preRendered()
}

allows dtml in rst. Using the idiom:

.. role:: raw-html(raw)
   :format: html

allows any dtml you like, like :raw-html:`&dtml-pageCount;` or other handiwork of the devil

The raw-html role "declaration" needs to be included, once, on each page that wants to use dtml.

does it work?

allows any dtml you like, like 2569 or other handiwork of the devil

well yes.

This is now a restructuredtext role, so the following sentence does not apply anymore:

this would be dtml/html only as a block-level element, inline is little bit harder and would probably require the addition of an "interpreted role" to restructuredtext.

thought this might be interesting for others too.

-- forwarded from http://zwiki.org/DevDiscussion#msg20040907014516-0700@zwiki.org

I see --simon, Sun, 15 Oct 2006 16:40:13 -0700 reply

I see this has changed, thanks for explaining. It seems quite a bit more limiting. In zwiki land we are not afraid to employ large blocks of dtml now and then, but I have not found a way to permit those.

testing if the raw directive is really disabled --strank, Fri, 24 Nov 2006 05:00:40 -0800 reply

Test:

bla page-count: 2569 bla

how to the raw directive back --strank, Fri, 24 Nov 2006 05:07:39 -0800 reply

So it is disabled. The only way to get it working is then AFAICT passing {'raw_enabled': 1} as settings_overrides option when zwiki calls docutils. Ideally this could be a folder level setting like dtml_enabled.

see also http://docutils.sourceforge.net/docs/howto/security.html#raw-html-insertion

restricted docutils --d2m, Fri, 24 Nov 2006 05:16:51 -0800 reply

starting last year and then in 2006 with 2 hotfixes affecting every zope version from 2.7 to 2.9 changes where made to disable the docutils raw and later on the include directives. current zopes (from zope2.9.3) are distributed with a patched docutils, disabling that directives in code.