wmllint: fixed non-empty tagstack errors due to [modify_ai] paths

This commit is contained in:
Elvish_Hunter 2018-09-30 23:57:37 +02:00 committed by Jyrki Vesterinen
parent fe26f513b8
commit fd26be92e0

View file

@ -2696,7 +2696,9 @@ def translator(filename, mapxforms, textxform):
if len(fields) > 1:
comment = fields[1]
# Now do warnings based on the state of the tag stack.
if not unbalanced:
# the regex check for "path=" is needed due to [modify_ai]
# which uses square braces in its syntax
if not unbalanced and not re.match(r"\s*path\=", destringed):
for instance in re.finditer(r"\[\/?\+?([a-z][a-z_]*[a-z])\]", destringed):
tag = instance.group(1)
closer = instance.group(0)[1] == '/'