wmllint: recognize amendment tags to avoid a crash

In certain situations, the 'directly_in_event' list was allowed to become empty and cause a crahs because the code was unable to handle amendment tags.
This commit is contained in:
Elvish_Hunter 2020-06-22 10:53:30 +02:00
parent 6b5da2a1a2
commit a364dfd669

View file

@ -1891,9 +1891,9 @@ to be called on their own".format(filename, num))
subtag_depth += 1
if "[/" in lines[i]:
subtag_depth -= 1
if "[event]" in lines[i]:
if "[event]" in lines[i] or "[+event]" in lines[i]:
directly_in_event.append(True)
elif re.search(r"\[[a-z]", lines[i]):
elif re.search(r"\[\+?[a-z]", lines[i]):
directly_in_event.append(False)
elif "[/" in lines[i]:
if len(directly_in_event) > 0: