Page MenuHomePhabricator

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


See for an example. The section heading "‎" 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

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
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

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

pasted_file (224×1 px, 132 KB)

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:

pasted_file (153×402 px, 19 KB)

headingText = surface.getModel().getDocument().data.getText(
	surface.getModel().getDocument().getDocumentNode().children[ 0 ].getRange()
).replace( /^\s*=+\s*(.*?)\s*=+\s*$/, '$1' ); 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

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