Page MenuHomePhabricator

Parsoid: Improve handling of links without rel types
Open, MediumPublicFeature


After editing the link text of external links which consist of just the full url in MediaWiki syntax (and therefore render as <a rel="mw:ExtLink/URL" href=""></a> in HTML), the diff shows no change.

There is also a question of confusing the user here as they may assume the link text and the url are somehow automatically linked, whereas currently the link inspector always deals with them separately.

Perhaps we need another mode for the link inspector when dealing with "mw:ExtLink/URL" where the link text and the url are kept the same until the user explicitly says otherwise.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:39 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz46027.

Another issue this presents is that opening a document and typing in a full URL suggests that your text will be plain, when in fact it is autolinked. Re-opening the page after saving and you now have linked text.

This could all be fixed in Parsoid with the following rules:

Label matches URL (and has no annotations)
html: <a href=""></a>

Plain text URL with no link annotation
wiki: <nowiki></nowiki>

Label doesn't match URL (already works)
html: <a href=""></a>
wiki: []

The case with annotations also already works as expected:
html: http://www.<b>google</b>.com
wiki: http://www.'''google'''.com
(which disables the auto linker)

As Gabriel noted we'll still need to keep mw:ExtLink/Numbered preserved (either via the UI, or by seeing if the label is still '[n]'), but this is essentially a Parsoid issue.

Change 71162 had a related patch set uploaded by GWicke:
Bug 46027: Drop mw:ExtLink/URL

Should be fixed once the above patch is merged.

Change 71162 merged by jenkins-bot:
Bug 46027, bug 49484: Drop mw:ExtLink/URL

[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

This case has not yet been implemented yet:

Label matches URL (and has no annotations)
html: <a href=""></a>

  • delete a 'yet' as you prefer :(

(In reply to comment #9 by jforrester)

Is this now fixed?

Ed: Do you know?

We still require the rel="mw:ExtLink" attribute. This serializes to just '':

<a rel="mw:ExtLink" href=""></a>

Per discussion on wikitext-l, we'll likely drop the rel requirement in the future, which would make even this work:

<a href=""></a>

Arlolra set Security to None.
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM
Aklapper removed subscribers: rmoen, GWicke.