Page MenuHomePhabricator

Source editor and VisualEditor force piped-link creation for links when using lower-case first character and more than one word
Closed, ResolvedPublicBUG REPORT

Description

Since about a week ago, both the source editor and VisualEditor force the creation of piped links when using the built-in hyperlink feature if the text is the same as the link AND the article has spaces in its title AND the text to be linked begins with a lowercase character.
Before, linking "five-year survival rate" or "short bowel syndrome" would result in "[[five-year survival rate]]" or "[[short bowel syndrome]]".
Now, it results in "[[Five-year survival rate|five-year survival rate]]" and "[[Short bowel syndrome|short bowel syndrome]]" every time.

Browser: Chrome 72.0.3626.121
OS: Windows 7 64-bit
Skin: Vector (default)

Event Timeline

Aklapper changed the task status from Open to Stalled.Mar 22 2019, 6:51 PM
  1. I go to https://www.mediawiki.org/w/index.php?title=VisualEditor:Test&veaction=edit to get the visual editor.
  2. I get the "Link" dialog.
  3. Under "Search pages", I enter "VisualEditor:Test".
  4. I choose the first item in the dropdown with the same page name.
  5. I click the "Insert" button.
  6. I click "Publish Changes".
  7. I go to https://www.mediawiki.org/w/index.php?title=VisualEditor:Test&action=edit to look at the wikitext source.
  8. It says [[VisualEditor:Test]] only.

Cannot reproduce. Please provide clearer steps, as a list, and which website this is about. See https://www.mediawiki.org/wiki/How_to_report_a_bug - thanks!

This comment was removed by SUM1.

This bug affects Wikipedia, Wikimedia, Wiktionary and probably other WMF websites (but the MediaWiki website itself seems to be case sensitive with links, so this bug is not possible).

I've worked out the conditions for reproduction. They're awkwardly precise but a hugely common encounter.
The title of the article has to have spaces in it, and the text to be linked has to begin with a lowercase character (but of course otherwise be the same as the article title, which is the point of this bug).

"Cancer" and "cancer" will both link correctly to the Cancer article, without a pipe.
"Cancer immunology" will link correctly to Cancer immunology, but "cancer immunology" will not, and will cause a pipe to form on every attempt. This bug was not present before about a week ago.

Jdforrester-WMF changed the task status from Stalled to Open.Mar 22 2019, 8:37 PM
Jdforrester-WMF added a project: Parsoid.
Jdforrester-WMF subscribed.

I can confirm those production steps. I think this is a Parsoid bug:

vagrant@vagrant:/vagrant/srv/parsoid$ echo "<a rel='mw:WikiLink' href='./VisualEditor'>visualEditor</a>" | node bin/parse.js --html2wt
[[visualEditor]]

vagrant@vagrant:/vagrant/srv/parsoid$ echo "<a rel='mw:WikiLink' href='./VisualEditor link'>visualEditor link</a>" | node bin/parse.js --html2wt
[[VisualEditor link|visualEditor link]]
Aklapper renamed this task from Bug (regression): both source editor and VisualEditor force piped-link creation to Source editor and VisualEditor force piped-link creation for links when using lower-case first character and more than one word.Mar 22 2019, 9:23 PM

Change 498513 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] html2wt: Fix 'isSimpleLink' detection

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

Jdforrester-WMF changed the subtype of this task from "Task" to "Bug Report".

Since about a week ago, ...

@SUM1 Are you suggesting this used to work? @ssastry claims this bug was present in Parsoid since at least the beginning of the year,
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/498513#message-dbb28282cd4e9bf37bfe1e126e2efe5f89d72ef6

Change 498513 merged by jenkins-bot:
[mediawiki/services/parsoid@master] html2wt: Fix 'isSimpleLink' detection

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

Since about a week ago, ...

@SUM1 Are you suggesting this used to work? @ssastry claims this bug was present in Parsoid since at least the beginning of the year,
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/498513#message-dbb28282cd4e9bf37bfe1e126e2efe5f89d72ef6

Beginning of the year wouldn't be unreasonable. I just know it wasn't like this in 2018. I noticed it about 2 weeks ago, and I regularly edit on Wikipedia.

We have never handled this case correctly. See below .. I checked out v0.8.0 and v0.7.0 (march 2017).

[subbu@earth:~/work/wmf/deploy] git checkout v0.8.0
HEAD is now at 6af7aa65 Updates for deb v0.8.0 pkg release
[subbu@earth:~/work/wmf/deploy] git submodule update --init
[subbu@earth:~/work/wmf/deploy] cd src
/home/subbu/work/wmf/deploy/src
[subbu@earth:~/work/wmf/deploy/src] echo "<a rel='mw:WikiLink' href='./VisualEditor link'>visualEditor link</a>" | node bin/parse.js --html2wt
[[VisualEditor link|visualEditor link]]

[subbu@earth:~/work/wmf/deploy/src] git log |head -3
commit 86fa722032ec3c9f17a516b9b452bc790389360a
Author: Arlo Breault <abreault@wikimedia.org>
Date:   Mon Oct 23 16:58:52 2017 -0400
[subbu@earth:~/work/wmf/deploy/src] cd ..
[subbu@earth:~/work/wmf/deploy] git checkout v0.7.0
Previous HEAD position was 6af7aa65 Updates for deb v0.8.0 pkg release
HEAD is now at a357742b Update debian changelog for deb 0.7.0 release
[subbu@earth:~/work/wmf/deploy] git submodule update --init
[subbu@earth:~/work/wmf/deploy] cd src
/home/subbu/work/wmf/deploy/src
[subbu@earth:~/work/wmf/deploy/src] echo "<a rel='mw:WikiLink' href='./VisualEditor link'>visualEditor link</a>" | node bin/parse.js --html2wt
[[VisualEditor link|visualEditor link]]

[subbu@earth:~/work/wmf/deploy/src] git log |head -3
commit 95b847013e2fba783716dfab644acda2ce75728d
Author: Subramanya Sastry <ssastry@wikimedia.org>
Date:   Thu Mar 30 16:06:05 2017 -0500

This will be deployed tomorrow probably.