| thiemowmde added subscribers: Lydia_Pintscher, thiemowmde, aude, hoo, WMDE-leszek, Jakob_WMDE, Jonas, Aleksey_WMDE. thiemowmde triaged this task as "High" priority. thiemowmde added a project: Wikidata-Sprint. thiemowmde moved this task from incoming to consider for next sprint on the Wikidata board. thiemowmde added a comment. |
The bug only happens in wikis with multiple language variants and is most probably a result of the most recent parser change described in https://www.mediawiki.org/wiki/Parsoid/Language_conversion/Preprocessor_fixups. Also see T146305: Parser should protect -{...}- variant constructs in links and related.
Steps to reproduce:
- Go to https://zh.wikipedia.org/wiki/%E6%96%B0%E6%B5%AA%E5%BE%AE%E5%8D%9A?setlang=en
- Edit the page (or a section) and preview the wikitext snippet {{#property:P856}}.
- The code in https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/client/includes/DataAccess/PropertyParserFunction/VariantsAwareRenderer.php;f1847571527218ef21444bbd81e3e36d62968090$83 creates wikitext enclosed in -{…}-.
- You can even try this yourself: -{zh:http://www.weibo.com;zh-hans:http://www.weibo.com;}- fails because the weblink regex does not stop at the semicolon, but eats everything before the -{…}- syntax had a chance to be parsed.
Possible solutions:
- We can not always add a space before all semicolons. This would make the weblink regex stop and fix the issue. But the space is never stripped, becomes part of the output, and will create all kinds of other issues. Try for yourself: a-{zh:b ;zh-hans:c ;}-d.
- In the example the wikitext snippet that is show to the user is always the same, in all variants. We can optimize our code and not output any -{…}- syntax if this is the case. I believe this is enough to fix all user-facing issues.
- We can change the weblink renderer to not output http://www.weibo.com, but [http://www.weibo.com http://www.weibo.com]. This is a heavy breaking change to the #property parser function we always wanted to avoid, and the reason we added the #statements function instead. However, we could make this change for languages with variants only, and leave it as it is in all other cases.
Originally reported at https://www.mediawiki.org/wiki/Topic:Trb03em5x4y2kypg.
TASK DETAIL
EMAIL PREFERENCES
To: thiemowmde
Cc: Aleksey_WMDE, Jonas, Jakob_WMDE, WMDE-leszek, hoo, aude, thiemowmde, Lydia_Pintscher, Liuxinyu970226, Aklapper, Cwek, GoranSMilovanovic, QZanden, Izno, LNDDYL, Fuzheado, Wikidata-bugs, zhuyifei1999, Shizhao, Mbch331
Cc: Aleksey_WMDE, Jonas, Jakob_WMDE, WMDE-leszek, hoo, aude, thiemowmde, Lydia_Pintscher, Liuxinyu970226, Aklapper, Cwek, GoranSMilovanovic, QZanden, Izno, LNDDYL, Fuzheado, Wikidata-bugs, zhuyifei1999, Shizhao, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
