# HG changeset patch # User Paul Boddie # Date 1543266334 -3600 # Node ID 84d3c5cd9f8f1a99d69eed6da0bc48ff63dc553f # Parent 38038aca413367c2bf8fa93b418b29f00f9aec92 Only parse directives if a region is transparent. Otherwise, they may be actual region content that the parser doesn't understand. diff -r 38038aca4133 -r 84d3c5cd9f8f moinformat/parsers/common.py --- a/moinformat/parsers/common.py Mon Nov 26 16:52:43 2018 +0100 +++ b/moinformat/parsers/common.py Mon Nov 26 22:05:34 2018 +0100 @@ -349,11 +349,9 @@ region = Region([], level, indent, type) - # Parse section headers and directives, then parse according to region - # type. + # Parse section headers, then parse according to region type. self.parse_region_header(region) - self.parse_region_directives(region) self.parse_region_type(region) return region @@ -370,6 +368,12 @@ if not parser: region.transparent = False parser = parser or self.get_parser("moin") + + # Only parse directives if the region is transparent. + + if region.transparent: + self.parse_region_directives(region) + parser.parse_region_content(self.items, region) def parse_region_header(self, region):