Page MenuHomePhabricator

Parsoid should autoconvert "[[link|lin]]<nowiki/>k" to "[[link]]"
Open, MediumPublic

Description

When I investigate cases of auto-inserted <nowiki> tags, I quite frequently come upon cases like [[link|lin]]<nowiki/>k—i.e., where concatenating the string between | and ]] with the text after <nowiki/> produces the same string as what appears between [[ and |. This will render as "lin​k".¹ While technically correct, this is never the editor's intention, and fixing this edit by removing the <nowiki/> tag, the "k" trail, and everything after the pipe is always required.

This should be simply automatically normalized to [[link]]. In 100% of cases that's what the editors actually want.

This is a sub-case of T141689, and it should be one of the easiest and least controversial instances thereof. As with that task, I only checked this consistently in the Hebrew Wikipedia and not in other languages. I cannot imagine that this would be different in other languages, but I'm willing to hear other arguments. If in other languages something like [[link|lin]]<nowiki/>k is actually useful, a per-language configuration may be made, but I doubt that this will ever be needed.

As a particular case of this, it's possible that the link target is not equal as a string to the concatenation of the link text and the link trail, but they are equal functionally, for example [[Link|lin]]<nowiki/>k. This should be normalized to [[link]] or maybe [[Link|link]] (but not [[Link]] or [[Link|lin]]k).


¹ There's a zero-width space between the link and the letter k in this task description. Parsoid and MediaWiki don't use it. I used it here for display purposes, because otherwise Phabricator wouldn't render it the way I needed. With the possible exception of HTML, all markup languages are awful.

Event Timeline

Amire80 created this task.Aug 14 2016, 7:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 14 2016, 7:23 AM
Amire80 updated the task description. (Show Details)Aug 14 2016, 11:29 AM
Jdforrester-WMF closed this task as Declined.Aug 16 2016, 7:24 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

As explained in the related tasks.

Restricted Application added a subscriber: jeblad. · View Herald TranscriptMay 18 2018, 3:27 PM
Dvorapa reopened this task as Open.May 20 2018, 5:22 PM

I would oppose. This seems to be completely unintentional

There's a lot of debate on the complexities of this, including some research I did into the prevalence of such constructs, in T128060.

Amire80 reopened this task as Open.Jan 2 2020, 11:09 AM

This is not a duplicate of T128060, although it is related.

Arlolra moved this task from Needs Triage to Backlog on the Parsoid board.Mar 2 2020, 5:27 PM
ssastry moved this task from Backlog to Feature requests on the Parsoid board.Mar 7 2020, 8:50 PM
JTannerWMF moved this task from To Triage to Triaged on the VisualEditor board.Mar 10 2020, 3:27 PM
JTannerWMF added a subscriber: JTannerWMF.

The Editing team can not prioritize this at this time.

ssastry triaged this task as Medium priority.Mar 11 2020, 4:09 AM