changeset 5809:7cd445089a84

TableOfContents: fixes that macro for other content than default wiki markup, e.g. rst
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 07 Dec 2011 08:46:01 +0100
parents 6e0a686893c3
children 83fe7e86cc0b
files MoinMoin/macro/TableOfContents.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/TableOfContents.py	Sat Dec 03 03:50:21 2011 +0100
+++ b/MoinMoin/macro/TableOfContents.py	Wed Dec 07 08:46:01 2011 +0100
@@ -157,7 +157,8 @@
 
     # this is so we get a correctly updated TOC if we just preview in the editor -
     # the new content is not stored on disk yet, but available as macro.parser.raw:
-    p.set_raw_body(macro.parser.raw, modified=1)
+    format = '#format %s\n' % p.pi['format']
+    p.set_raw_body(format + macro.parser.raw, modified=1)
 
     output = macro.request.redirectedOutput(p.send_page,
                                             content_only=True,