# HG changeset patch # User Paul Boddie # Date 1339871626 -7200 # Node ID 8de8a75d3bacc73c57ec4dd54959a26be1b51e13 # Parent bbc00d24573e13a3ecd4523fce50fc42208bbe33 Changed fragment recognition to look for a "moinshare" region attribute. diff -r bbc00d24573e -r 8de8a75d3bac MoinShare.py --- a/MoinShare.py Wed Apr 18 01:13:25 2012 +0200 +++ b/MoinShare.py Sat Jun 16 20:33:46 2012 +0200 @@ -27,7 +27,10 @@ marker_regexp_str = r"([{]{3,}|[}]{3,})" marker_regexp = re.compile(marker_regexp_str, re.MULTILINE | re.DOTALL) # {{{... or }}}... -fragment_prelude = "#!MoinShare " +# Fragments employ a "moinshare" attribute. + +fragment_prelude = "#!" +fragment_attribute = "moinshare" def getRegions(s): @@ -87,7 +90,9 @@ body = region.lstrip("{").rstrip("}") if body.startswith(fragment_prelude): arguments, body = body[len(fragment_prelude):].split("\n", 1) - fragments.append((parseAttributes(arguments, False), body)) + attributes = parseAttributes(arguments, False) + if attributes.has_key(fragment_attribute): + fragments.append((attributes, body)) return fragments diff -r bbc00d24573e -r 8de8a75d3bac tests/test_regions.py --- a/tests/test_regions.py Wed Apr 18 01:13:25 2012 +0200 +++ b/tests/test_regions.py Sat Jun 16 20:33:46 2012 +0200 @@ -11,7 +11,7 @@ This is ''testing'' shared content. }}} -{{{#!MoinShare format=html fragment=100 +{{{#!html fragment=100 moinshare
Test some HTML content.