tatuylonen / wikitextprocessor

Python package for WikiMedia dump processing (Wiktionary, Wikipedia etc). Wikitext parsing, template expansion, Lua module execution. For data extraction, bulk syntax checking, error detection, and offline formatting.
Other
94 stars 23 forks source link

`<ref>` should ignore whitespace preformatted lines #339

Closed kristian-clausal closed 5 days ago

kristian-clausal commented 1 week ago

Fixes second part of #336

When we would normally be pushing a layer of NodeKind.PREFORMATTED, check if the stack has any HTML-elements with the <ref> tag and if that is the case don't push PREFORMATTED.

If other HTML-like tags need this in the future (onlyinclude? includeonly??) then this is the place where to add those checks.

Looking through the stack could be better. Filter? Any? Oh yeah, duh.

xxyzz commented 5 days ago

Thanks for the fix! And I also add the "p" tag to the "if" check line.