Fix very dangerous pattern, support {{infl of}}

This commit is contained in:
Kiril Kovachev 2023-09-02 17:27:21 +01:00
parent aee5025ba5
commit 979698bad9

View File

@ -25,7 +25,7 @@ def main() -> None:
except IndexError:
print(f"Error: page {title} has no Bulgarian content", file=sys.stderr)
for inflection_template in bulgarian_section.filter(forcetype=mwparserfromhell.wikicode.Template, matches="{{inflection of|bg|.*?}}"):
for inflection_template in bulgarian_section.filter(forcetype=mwparserfromhell.wikicode.Template, matches=r"{{infl(?:ection)? of\|bg\|.*?}}"):
inflection_template: mwparserfromhell.wikicode.Template
fix_inflection(inflection_template)