wmllint: Stop looking for wml tags inside [lua]

wmllint should not search for wml tags and keys inside [lua].
I caught it trying to add a _ in 23_Test_of_the_Clans inside a lua tag.
This commit is contained in:
Andrey Bienkowski 2021-01-19 16:47:33 +03:00 committed by Elvish_Hunter
parent 137a511586
commit 09be367357

View file

@ -1888,6 +1888,7 @@ to be called on their own".format(filename, num))
in_map_generator = False
in_name_generator = False
in_candidate_action = False
in_lua = False
storeid = None
storevar = None
ignoreable = False
@ -1898,6 +1899,13 @@ to be called on their own".format(filename, num))
translation_mark = re.compile(r'_ *"')
name_generator_re = re.compile(r"name_generator\s*=\s*_\s*<<")
for i in range(len(lines)):
if has_opening_tag(lines[i], "lua"):
in_lua = True
elif "[/lua]" in lines[i]:
in_lua = False
if in_lua:
# As far as I can tell none of the below tests make sense inside of a lua tag
continue
if '[' in lines[i]:
preamble_seen = True
# This logic looks odd because a scenario can be conditionally