Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment