diff --git a/parser.py b/parser.py index fee6709320eeb3b5e21924ac42a959299267881a..74d44763d92d7f510e12b0d71c787292160c2756 100644 --- a/parser.py +++ b/parser.py @@ -158,7 +158,9 @@ class Content(Element): # v3: does not allow braces in the content #PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)*);?" # v4: do not allow empty match (require either the first or the second part to be non-empty) - PATTERN = r"\s*(?<content>(?:(?:[^\[\];\r\n{}]+)|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+));?" + #PATTERN = r"\s*(?<content>(?:(?:[^\[\];\r\n{}]+)|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+));?" + # v5: do match emptystring if followed by a semi colon + PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+);?|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+;?|;)" class Text: def __init__(self, text, linenumber, fork):