Page MenuHomePhabricator

HTML entities in "comma-separator" is not rendered in edit tags
Closed, ResolvedPublicBUG REPORT

Description

https://www.wikidata.org/w/index.php?title=Q7001994&curid=6878173&diff=1590750227&oldid=987557645&uselang=zh-tw
The message is 、​ https://www.wikidata.org/w/index.php?title=MediaWiki:Comma-separator/zh-tw&action=edit

Capture.PNG (67×787 px, 8 KB)

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
1.38.0-wmf.25 (2b818a6)

Event Timeline

Related code is here https://gerrit.wikimedia.org/g/mediawiki/core/+/da7bb46849c44b6e8082f2b527ebd810ccd5d97a/resources/src/mediawiki.interface.helpers.styles.less#95
The bug is due to recent change to message "comma-separator" on translatewiki https://translatewiki.net/w/i.php?title=MediaWiki:Comma-separator/zh-hant&diff=10579967&oldid=7483822
But I don't know why   is supported in mediawiki.interface.helpers.styles.less, but ​ isn't.

It's not clear to me that this has anything to do with changes in the 1.38.0-wmf.25 deployment.

  and a few other entities are special-cased to work even in messages that otherwise only allow plain text, and no HTML markup: https://gerrit.wikimedia.org/g/mediawiki/core/+/da7bb46849c44b6e8082f2b527ebd810ccd5d97a/includes/cache/MessageCache.php#975

@Xiplus Based on your comment, I'm going to remove this as a train blocker. If you believe this problem is a regression caused by this week's train (and not by the change made on translatewiki), we can discuss it.

@dancy Is it possible to apply a hot-fix patch to remove ​ from zh-hans.json and zh-hant.json. Otherwise it will break the interface until next l10n messages update.

It should be possible to handle ​ as the line break rendering will be broken in https://translatewiki.net/wiki/Special:ActiveLanguages/zh-hans?uselang=zh-hans , https://translatewiki.net/wiki/Special:ActiveLanguages/zh-hant?uselang=zh-hant and other languages/writing systems doesn't use whitespace as a word separator without the manual soft-line-break character.

Change 769826 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] Fix for zero-width whitespace (ZWSP) in MessageCache

https://gerrit.wikimedia.org/r/769826

Without zero-width space (unexpected line break):

image.png (955×1 px, 379 KB)

With zero-width space (expected line break):

image.png (787×1 px, 361 KB)

By the way, it seems there's a hard-coded whitespace between span.mw-tag-marker items, which should already be included in MediaWiki:Comma-separator . The hard-coded whitespace should be removed in my POV.

In my testing ZWSP can be added as literal unicode character and there is no need to escape it to prevent it from being trimmed.

In my testing ZWSP can be added as literal unicode character and there is no need to escape it to prevent it from being trimmed.

The reason not directly typing it is due to it's actually "invisible" in editors, and the users might not be aware of it.

Change 769826 abandoned by Winston Sung:

[mediawiki/core@master] Fix for zero-width whitespace (ZWSP) in MessageCache

Reason:

(use copied character instead of ​)

https://gerrit.wikimedia.org/r/769826

Capture.PNG (46×358 px, 2 KB)

I found the same error in the email. I'm not sure if this is relevant.

It is. The translation is already fixed and please wait for the update/sync.

Winston_Sung changed the task status from Open to In Progress.Mar 11 2022, 8:12 AM

(Will be fixed after the translations updated from translatewiki.)

Stang assigned this task to Winston_Sung.
Stang unsubscribed.