Page MenuHomePhabricator

NWE adds links in summary when section headings are linked, while OWE doesn't
Closed, ResolvedPublic1 Estimated Story Points

Description

See https://de.wikipedia.org/w/index.php?title=Wikipedia:L%C3%B6schkandidaten/3._April_2017&offset=20170404000000&limit=10&action=history&tagfilter= for an example. The section heading "‎Korrekturen.de" is linked.

Edits done with NWE (those 2 by Crown-job) have this link in the edit summary, too, edits with OWE (Wassertraeger and CorrectHorseStapleBattery) don't. Even though none of these variants is wrong, it would be nice if the two editors were consistent. In the NWE variant there are two adjacent links (one to the section, and one to the page linked in the section heading), which might be a bit confusing.

The visual mode strips the links like OWE does, as you can test with https://de.wikipedia.org/wiki/1999#Geboren

Event Timeline

Schnark created this task.Apr 3 2017, 8:29 AM
Restricted Application added a project: VisualEditor. · View Herald TranscriptApr 3 2017, 8:29 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF triaged this task as Low priority.Apr 4 2017, 7:19 PM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.

I assume you mean https://de.wikipedia.org/w/index.php?title=Diskussion:James_N._Mattis&action=history?

I know that @DLynch was looking at this code last week or so.

DLynch added a comment.Apr 4 2017, 7:46 PM

i.e. the bits where (→‎FM 3-24 Counterinsurgency) is linked-or-not.

This is because it's just taking the contents of the section-heading as-is, and in this page it contains a link:

headingText = surface.getModel().getDocument().data.getText(
	false,
	surface.getModel().getDocument().getDocumentNode().children[ 0 ].getRange()
).replace( /^\s*=+\s*(.*?)\s*=+\s*$/, '$1' );

...so it's not super-sophisticated.

(I actually only touched the visual parts of this, mostly bypassing the NWE aspects.)

It'd be pretty easy to have it, e.g., strip any wikitext links that wrap the entire section heading.

Change 346566 had a related patch set uploaded (by DLynch):
[mediawiki/extensions/VisualEditor@master] ArticleTarget: building summary in source mode, strip links from section titles

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

Jdforrester-WMF closed this task as Resolved.Apr 5 2017, 11:46 PM
Jdforrester-WMF assigned this task to DLynch.
Jdforrester-WMF removed a project: Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptApr 5 2017, 11:46 PM

Change 346566 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ArticleTarget: building summary in source mode, strip links from section titles

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