earwig / mwparserfromhell

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

`[[]]` and `[[|]]` should not be treated as wikilinks #292

Open BrandonXLF opened 2 years ago

BrandonXLF commented 2 years ago

The strings "[[]]" and "[[|]]" (empty "wikilinks") are not treated as wikilinks by MediaWiki and shouldn't be treated as such here either.

lahwaacz commented 2 years ago

mwparserfromhell cannot always check if the tokens inside double brackets are empty or |. Consider e.g. [[{{echo|}}]] and [[{{!}}]], these are context-sensitive and mwparserfromhell has no chance to behave the same as MediaWiki because it does not expand templates.