1.1 --- a/MoinShare.py Wed Apr 18 01:13:25 2012 +0200
1.2 +++ b/MoinShare.py Sat Jun 16 20:33:46 2012 +0200
1.3 @@ -27,7 +27,10 @@
1.4 marker_regexp_str = r"([{]{3,}|[}]{3,})"
1.5 marker_regexp = re.compile(marker_regexp_str, re.MULTILINE | re.DOTALL) # {{{... or }}}...
1.6
1.7 -fragment_prelude = "#!MoinShare "
1.8 +# Fragments employ a "moinshare" attribute.
1.9 +
1.10 +fragment_prelude = "#!"
1.11 +fragment_attribute = "moinshare"
1.12
1.13 def getRegions(s):
1.14
1.15 @@ -87,7 +90,9 @@
1.16 body = region.lstrip("{").rstrip("}")
1.17 if body.startswith(fragment_prelude):
1.18 arguments, body = body[len(fragment_prelude):].split("\n", 1)
1.19 - fragments.append((parseAttributes(arguments, False), body))
1.20 + attributes = parseAttributes(arguments, False)
1.21 + if attributes.has_key(fragment_attribute):
1.22 + fragments.append((attributes, body))
1.23
1.24 return fragments
1.25
2.1 --- a/tests/test_regions.py Wed Apr 18 01:13:25 2012 +0200
2.2 +++ b/tests/test_regions.py Sat Jun 16 20:33:46 2012 +0200
2.3 @@ -11,7 +11,7 @@
2.4 This is ''testing'' shared content.
2.5 }}}
2.6
2.7 -{{{#!MoinShare format=html fragment=100
2.8 +{{{#!html fragment=100 moinshare
2.9 <table>
2.10 <tr>
2.11 <td>Test some <strong>HTML</strong> content.</td>