wmllint: replaced gif with webp in two regexps

This commit is contained in:
Elvish_Hunter 2022-05-01 11:19:06 +02:00
parent f17b8b76e9
commit 52da1fa774

View file

@ -2690,8 +2690,8 @@ def hack_syntax(filename, lines):
precomment = re.split(r'\s#', lines[i], 1)[0]
comment = lines[i][len(precomment):]
if '\\' in precomment:
while re.search(r'(?<!\\)\\(?!\\)[^ ={}"]+\.(png|ogg|wav|gif|jpe?g|map|mask|cfg)\b', precomment, flags=re.IGNORECASE):
backslash = re.search(r'([^ ={}"]*(?<!\\)\\(?!\\)[^ ={}"]+\.)(png|ogg|wav|gif|jpe?g|map|mask|cfg)(?=\b)', precomment, flags=re.IGNORECASE)
while re.search(r'(?<!\\)\\(?!\\)[^ ={}"]+\.(png|ogg|wav|webp|jpe?g|map|mask|cfg)\b', precomment, flags=re.IGNORECASE):
backslash = re.search(r'([^ ={}"]*(?<!\\)\\(?!\\)[^ ={}"]+\.)(png|ogg|wav|webp|jpe?g|map|mask|cfg)(?=\b)', precomment, flags=re.IGNORECASE)
fronted = backslash.group(1).replace("\\","/") + backslash.group(2)
precomment = precomment[:backslash.start()] + fronted + precomment[backslash.end():]
print('"%s", line %d: %s -> %s -- please use frontslash (/) for cross-platform compatibility' \