pediapress/mwlib — Issue #11: Undeterministic behavior when parsing styles
Author: DavidNemeskey
Created: 2012-03-09 11:05:37+00:00
State: open

I have run into a problem with mwlib when parsing the Hungarian Wikipedia. There is a bug in the source of the page "Háromhúros brácsa": the number of opening and closing apostrophes around a text segment do not match: ''d'''. I understand how this can confuse a parser; however, I cannot understand why it has to confuse it in a different way each time!

Here are the logs of two runs:
---------------------------------------
handle_style Style"''"
handle_default
handle_text: d
handle_style Style"'''"
handle_default

handle_style Style"''"
handle_default
handle_text: helyett
handle_style Style"'''"
handle_default
---------------------------------------

vs.

---------------------------------------
handle_style Style"''"
handle_default
handle_text: d

handle_default
handle_text: ' helyett
handle_style Style"''"
handle_default
---------------------------------------

Also, the page handling remains inconsistent and undeterministic throughout the rest of the page. Our code relies on parsing the page two times, and with the same results, so this is a showstopper for us.