# HG changeset patch # User Paul Boddie # Date 1353967718 -3600 # Node ID a8fd39bc4d997e09cae5e9b527b5b12a417a38c2 # Parent 589f0c25922890c8f36c05de6189b99b4d44f582 Fixed the recording of end markers, adding them to the regions they define. diff -r 589f0c259228 -r a8fd39bc4d99 MoinSupport.py --- a/MoinSupport.py Sun Nov 25 01:01:46 2012 +0100 +++ b/MoinSupport.py Mon Nov 26 23:08:38 2012 +0100 @@ -218,11 +218,17 @@ # Handle section markers. - elif not is_block: + else: # Close any open sections, returning to exposed text regions. if marker: + + # Add any marker to the current region, regardless of whether it + # successfully closes a section. + + regions[-1] += match_text + if match_text.startswith("}") and len(marker) == len(match_text): marker = None @@ -231,16 +237,15 @@ if include_non_regions: regions.append("") - # Without a current marker, start a section if an appropriate marker - # is given. + # Without a current marker, start a new section. - elif match_text.startswith("{"): + else: marker = match_text regions.append("") - # Markers and section text are added to the current region. + # Add the marker to the new region. - regions[-1] += match_text + regions[-1] += match_text # The match text alternates between text between markers and the markers # themselves.