earwig / mwparserfromhell

A Python parser for MediaWiki wikicode
https://mwparserfromhell.readthedocs.io/
MIT License
741 stars 74 forks source link

`}}` in parameter value wrongly recognized as end of template #290

Open not-my-profile opened 2 years ago

not-my-profile commented 2 years ago
text = '''
{{hello
|foo={{A}, {B}}
|bar=123
}}
'''

import mwparserfromhell

print(mwparserfromhell.parse(text).filter_templates())

Expected output:

['{{hello\n|foo={{A}, {B}}\n|bar=123\n}}']

Received output:

['{{hello\n|foo={{A}, {B}}']