Page MenuHomePhabricator

VE inserts formatting into link description
Closed, ResolvedPublic

Description

VE inserts text formatting (bold / italics) into the link description, even in the cases where the whole link is to be formatted uniformly; so the wikicode becomes more obfuscated.

e.g. https://cs.wikipedia.org/w/index.php?title=Mimozem%C5%A1%C5%A5an%C3%A9&diff=prev&oldid=22829304

In cases, when the formatting is applied to the whole link, it would be better to apply formatting tags around wikilink.

  • [[Star Wars|''Star Wars'']] → ''[[Star Wars]]''

Event Timeline

MSantos edited projects, added Parsoid (Tracking); removed Parsoid.
MSantos subscribed.

We will investigate but triaging it as tracking on the Parsoid board for now.

We should investigate and figure out if this is a Parsoid bug or a Visual Editor bug. Neither @Arlolra nor I could remember if this was part of the HTML normalizations that Parsoid does (in which case this would be a Parsoid bug/missing feature) or if we just use whatever tag order VE gives us (in which case this would be a VE issue w/ how they place the <b> tags they give Parsoid.

ABreault-WMF edited projects, added Parsoid; removed Parsoid (Tracking).
ABreault-WMF subscribed.

Hmm, this looks like a normalization that Parsoid is supposed to be doing,
https://www.mediawiki.org/wiki/Parsoid/Normalizations#Move_formatting_from_link_text_to_the_entire_link_(with_some_exceptions)

And there are a bunch of parserTests, "1. Move format tags outside of WikiLink", etc

But looking at the diff, all these links have spaces in the target.

λ (master) echo '<a rel="mw:WikiLink" href="./Foot ball"><i>Foot ball</i></a>' | php bin/parse.php --html2wt
''[[Foot ball]]''

λ (master) echo '<a rel="mw:WikiLink" href="./Foot_ball"><i>Foot ball</i></a>' | php bin/parse.php --html2wt
[[Foot ball|''Foot ball'']]

It looks like the normalizer is getting tripped up on the underscore.

ABreault-WMF moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change #1225684 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Fix moving format tags out of wikilinks with spaces in target

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

Change #1225684 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Fix moving format tags out of wikilinks with spaces in target

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

Change #1226985 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Don't move out format tags when originating as piped

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

Change #1226985 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Don't move out format tags when originating as piped

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

Change #1228553 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a12

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

Change #1228553 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a12

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