Page MenuHomePhabricator

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

Description

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="http://google.com">http://google.com</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

Details

Reference
bz46027

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="http://www.google.com">http://www.google.com</a>
wiki: http://www.google.com

Plain text URL with no link annotation
html: http://www.google.com
wiki: <nowiki>http://www.google.com</nowiki>

Label doesn't match URL (already works)
html: <a href="http://www.google.com">http://www.google.co.uk</a>
wiki: [http://www.google.com http://www.google.co.uk]

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

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

Should be fixed once the above patch is merged.

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

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

[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="http://www.google.com">http://www.google.com</a>
wiki: http://www.google.com

  • 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 'http://www.google.com':

<a rel="mw:ExtLink" href="http://www.google.com">http://www.google.com</a>

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

<a href="http://www.google.com">http://www.google.com</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.