Page MenuHomePhabricator

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

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 Normal.Nov 22 2014, 1:39 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz46027.
Esanders created this task.Mar 12 2013, 1:57 PM

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 :(

Is this now fixed?

(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 removed GWicke as the assignee of this task.Nov 25 2014, 8:09 PM
Arlolra set Security to None.
ssastry moved this task from Backlog to Robustness on the Parsoid board.Dec 22 2014, 12:52 AM
marcoil moved this task from Robustness to Backlog on the Parsoid board.Feb 13 2015, 12:49 PM
Krinkle removed a subscriber: Krinkle.Jan 12 2018, 10:48 PM