Commit 47ede2e6 authored by Administrator's avatar Administrator
Browse files

Do not match an emptystring to content, which resulted in a infinite loop

parent f825a887
......@@ -156,7 +156,9 @@ class Content(Element):
# v2: does not require the semicolon, but the newline
#PATTERN = r"\s*(?<content>(?:[^\[\];\r\n]+)?(?:\[[^\]\r\n]+\][^;\[\]\r\n]*)*);?"
# v3: does not allow braces in the content
PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)*);?"
#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{}]*)+));?"
class Text:
def __init__(self, text, linenumber, fork):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment