1.1 --- a/MoinSupport.py Sun Nov 25 01:01:46 2012 +0100
1.2 +++ b/MoinSupport.py Mon Nov 26 23:08:38 2012 +0100
1.3 @@ -218,11 +218,17 @@
1.4
1.5 # Handle section markers.
1.6
1.7 - elif not is_block:
1.8 + else:
1.9
1.10 # Close any open sections, returning to exposed text regions.
1.11
1.12 if marker:
1.13 +
1.14 + # Add any marker to the current region, regardless of whether it
1.15 + # successfully closes a section.
1.16 +
1.17 + regions[-1] += match_text
1.18 +
1.19 if match_text.startswith("}") and len(marker) == len(match_text):
1.20 marker = None
1.21
1.22 @@ -231,16 +237,15 @@
1.23 if include_non_regions:
1.24 regions.append("")
1.25
1.26 - # Without a current marker, start a section if an appropriate marker
1.27 - # is given.
1.28 + # Without a current marker, start a new section.
1.29
1.30 - elif match_text.startswith("{"):
1.31 + else:
1.32 marker = match_text
1.33 regions.append("")
1.34
1.35 - # Markers and section text are added to the current region.
1.36 + # Add the marker to the new region.
1.37
1.38 - regions[-1] += match_text
1.39 + regions[-1] += match_text
1.40
1.41 # The match text alternates between text between markers and the markers
1.42 # themselves.