Closed kno10 closed 7 years ago
Thanks for the bug report. I can confirm the problem. Moving the sanity check up won't work since it will then also apply to the fragment part. Moving the conversion of space -> underscore down might work. Then the conversion would also not affect the fragment which makes sense. I'll look into it.
Fixed in version 2.2.0
As the error indicates, links to this page will parse as invalid entites, even when written with space, because
&_The_Perfect_Foil;
apparently would be a valid XML entity name.The error is in org.sweble.wikitext.parser.parser.LinkTargetParser.parse(LinkTargetParser.java:180)
Maybe the logic can be changed, and the sanity check moved before the entity matching (e.g. after
xmlDecode
)?The line
result = StringUtils.trim(result);
can probably be removed - afterwards, whitespace is substituted with underscores, and underscores are trimmed again.