Page MenuHomePhabricator

Show a warning if the same named ref tag has two conflicting dir values
Closed, ResolvedPublic

Description

This example should generate a warning:

A named references defined in RTL direction<ref name=x dir=rtl>right-to-left.</ref> and reused in LTR direction<ref name=x dir=ltr />

But this should not:

A named references defined in LTR direction<ref name=x dir=rtl>right-to-left.</ref> and reused in LTR direction<ref name=x />

even if the wiki's content language is LTR; i.e. when no dir is provided in short form ref tags, it should imply the content language's directionality, except if the full ref tag specifies a directionality in which case that should be used.

Implementation

Open questions for UX

  • wording of error message - suggestion: "There are two conflicting dir values in this reference"

Event Timeline

Huji updated the task description. (Show Details)

But I'm reading these two tasks, and I do not understand something important. Do you mean that from now on a named ref should have the same dir parameter on all instances? Why? Who needs the dir in all instances without text? It's redundunt information and it will disturb the user to write it over and over again, I believe it will be better if the instance with text will be used for direction, and the rest must be without dir parameter at all, throwing an error message if they are. What do you think?

Fair, I updated the task in accorance with the recommendation by @IKhitron

But, an example

A named references defined in LTR direction<ref name=x dir=rtl>right-to-left.</ref> and reused in LTR direction<ref name=x dir=rtl />

should generate a warning too. I mean, it should not be checked what is the value of dir in the instance without text.

Change 893013 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Add test case with conflicting dir="…" values

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

Change 893013 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Add test case with conflicting dir="…" values

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

Change 982355 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] Track errors in a status object instead of an array

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

Change 982367 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Extract validation to a separate class

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

Change 982368 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Move Validator tests to a separate class

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

awight moved this task from Doing to Sprint Backlog on the WMDE-TechWish-Sprint-2023-12-06 board.
awight subscribed.

Change 983132 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] Show warning when dir="…" don't match

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

Change 983132 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Show warning when dir="…" don't match

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

Change 987392 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Capitalized dir="RTL" should not trigger any error

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

Change 987397 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/services/parsoid@master] Show warning when dir="…" don't match

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

Change 987392 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Capitalized dir="RTL" should not trigger any error

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

Change 987397 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Show warning when dir="…" don't match

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

Change 992095 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.19.0-a14

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

Change 992095 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.19.0-a14

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

Tobi_WMDE_SW subscribed.

remaining todo: UX & Engineering will assess the error messages together.