wmllint: Exclude preprocessor directives from [part] children check

This solves spurious errors when attempting to use #ifdef within [part].
This commit is contained in:
Ignacio R. Morelle 2013-05-22 21:37:03 -04:00
parent 4e5ebba351
commit 96be3ead4c

View file

@ -845,7 +845,7 @@ def local_sanity_check(filename, nav, key, prefix, value, comment):
if m and not m.group(1):
print errlead + 'translatability mark before non-string'
# Most tags are not allowed with [part]
if "[part]" in ancestors and parent not in ("[part]", "[image]", "[insert_tag]", "[if]", "[then]", "[else]", "[switch]", "[case]", "[variable]", "[deprecated_message]"):
if "[part]" in ancestors and parent not in ("[part]", "[image]", "[insert_tag]", "[if]", "[then]", "[else]", "[switch]", "[case]", "[variable]", "[deprecated_message]") and not parent.startswith("#"):
print errlead + '%s not permitted within [part] tag' % parent
# Most tags are not permitted inside [if]
if len(ancestors) >= 2 and ancestors[-1] == "[if]":