changeset 3045:d44007999460

gui editor macro dialog: fix broken html, use new regex for parsing HelpOnMacros (ported from 1.6)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 19 Feb 2008 23:09:21 +0100
parents bf99a66453d3
children 596d4a8ba580
files MoinMoin/action/fckdialog.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/fckdialog.py	Tue Feb 19 22:29:39 2008 +0100
+++ b/MoinMoin/action/fckdialog.py	Tue Feb 19 23:09:21 2008 +0100
@@ -119,7 +119,7 @@
             helptext = ""
         helptexts.append(
             '''<div id="%s" style="DISPLAY: none">
-               <b><<%s>></b>
+               <b>&lt;&lt;%s&gt;&gt;</b>
                <br/>
                <textarea style="color:#000000" cols="37" rows="10" disabled="disabled">%s</textarea>
                </div>'''
@@ -148,10 +148,11 @@
     helppage = wikiutil.getLocalizedPage(request, "HelpOnMacros")
     content = helppage.get_raw_body()
     macro_re = re.compile(
-        r"\|\|(<.*?>)?\{\{\{\[\[" +
-        r"(?P<prototype>(?P<macro>\w*).*)" +
-        r"\]\]\}\}\}\s*\|\|" +
-        r"\s*(?P<help>.*?)\s*\|\|\s*(?P<example>.*?)\s*\|\|$", re.U + re.M)
+        r"\|\|(<.*?>)?\{\{\{" +
+        r"<<(?P<prototype>(?P<macro>\w*).*)>>" +
+        r"\}\}\}\s*\|\|" +
+        r"[^|]*\|\|[^|]*\|\|<[^>]*>" +
+        r"\s*(?P<help>.*?)\s*\|\|\s*(?P<example>.*?)\s*(<<[^>]*>>)*\s*\|\|$", re.U|re.M)
     help = {}
     for match in macro_re.finditer(content):
         help[match.group('macro')] = match