1.1 --- a/TO_DO.txt Wed May 29 17:16:31 2013 +0200
1.2 +++ b/TO_DO.txt Wed May 29 17:19:17 2013 +0200
1.3 @@ -1,6 +1,9 @@
1.4 DEV/A 5 Minute Guide to Get the Mailman Web UI Running (only for development) (13303877)
1.5
1.6 - Preformatted regions on their own line might be converted into proper sections
1.7 + (Preformatted regions on their own line might be converted into proper sections)
1.8 + This was hopefully fixed by recognising that such regions are not inline
1.9 + formatting directives
1.10 +
1.11 This may affect both markup types but this page seems not to be available in
1.12 the XHTML format
1.13
2.1 --- a/wikiparser.py Wed May 29 17:16:31 2013 +0200
2.2 +++ b/wikiparser.py Wed May 29 17:19:17 2013 +0200
2.3 @@ -465,10 +465,10 @@
2.4 "code" : "",
2.5 "noformat" : "",
2.6 "quote" : "",
2.7 - "info" : "#!wiki important\n",
2.8 - "note" : "#!wiki caution\n",
2.9 - "tip" : "#!wiki tip\n",
2.10 - "warning" : "#!wiki warning\n",
2.11 + "info" : "#!wiki important",
2.12 + "note" : "#!wiki caution",
2.13 + "tip" : "#!wiki tip",
2.14 + "warning" : "#!wiki warning",
2.15 }
2.16
2.17 preformatted_sectiontypes = (None, "noformat")
2.18 @@ -521,18 +521,11 @@
2.19 parts.append("\n")
2.20 mointype = sectiontypes[sectiontype]
2.21
2.22 - parts.append("{{{%s" % (mointype or ""))
2.23 - text = text.strip()
2.24 -
2.25 - # Sections containing newlines must have a separate header line.
2.26 -
2.27 - if options or text.find("\n") != -1:
2.28 - parts.append("\n")
2.29 -
2.30 + parts.append("{{{%s\n" % (mointype or ""))
2.31 if options:
2.32 parts.append("## %s\n" % options)
2.33 - parts.append(translate_content(text, sectiontype))
2.34 - parts.append("%s}}}\n" % (mointype and "\n" or ""))
2.35 + parts.append(translate_content(text.strip(), sectiontype))
2.36 + parts.append("\n}}}\n")
2.37
2.38 preceded_by_block = True
2.39
2.40 @@ -545,15 +538,9 @@
2.41 # Unrecognised sections.
2.42
2.43 else:
2.44 - parts.append("{{{")
2.45 -
2.46 - # Sections containing newlines must have a separate header line.
2.47 -
2.48 - if text.find("\n") != -1 and not text.startswith("\n"):
2.49 - parts.append("\n")
2.50 -
2.51 - parts.append(translate_content(text, sectiontype))
2.52 - parts.append("}}}")
2.53 + parts.append("{{{\n")
2.54 + parts.append(translate_content(text.strip(), sectiontype))
2.55 + parts.append("\n}}}\n")
2.56 preceded_by_block = False
2.57
2.58 return "".join(parts)