Upstream PR: earwig/mwparserfromhell#362
Empty-title wikilinks such as [[]], [[|]], [[|foo]], and [[|||]] were returned by filter_wikilinks(). That was surprising for callers that ask for usable wikilinks, but simply dropping the nodes from the parse tree would remove information downstream tools may need for repair.
The parser should preserve invalid wikilink nodes in the generic parse tree, while wikilink-specific filters should skip empty-title links consistently.
The empty-title skip moved into the shared _indexed_ifilter() path for forcetype is Wikilink. That keeps filter_wikilinks(), filter(forcetype=Wikilink), and ifilter(forcetype=Wikilink) semantically aligned while preserving the original node.
- Focused regression tests -> 5 passed
tests/test_parser.py tests/test_wikicode.py-> 31 passed- Full test suite -> 2010 passed, 1 skipped
ruff checkandruff format --checkon changed files -> passedgit diff --check-> passed