Page MenuHomePhabricator

Automatically recognise bare links and magic links (ISBN/etc.), and display as a link
Closed, ResolvedPublic40 Estimated Story Points

Description

Adding "ISBN 0-471-17864-0" doesn't render the ISBN as a link. This is more important in the reference tool, but should work on all rich text surfaces.

See also:

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:59 AM
bzimport set Reference to bz52204.

I guess the other Magic links http://www.mediawiki.org/wiki/Markup_spec/BNF/Magic_links
for RFC and PMID should be included here.

This works for me, but perhaps not as expected.

You can add:

PMIDs: http://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=563393942&oldid=563393897

ISBNs without hyphenation: http://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=567704513&oldid=564410882

ISBNs with hyphens: http://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=567704681&oldid=567704513

Exactly like the classic wikitext editor, these do not display as being links until after they are saved. They do work correctly when saved.

After they have been saved, if you go back into VisualEditor to edit again, then the PMID and hyphenated ISBNs are not editable or clickable (except to select the whole element). Changes to them must be made by deleting the whole thing and retyping from scratch.

Clicking on the non-hyphenated ISBN, however, results in a failed attempt to go directly to the ISBN search page, with this resulting error:

Error
404 – File not found
http://en.wikipedia.org/Special:BookSources/9781234567890
We could not find the above page on our servers.
Did you mean to type http://en.wikipedia.org/wiki/Special:BookSources/9781234567890? You will be automatically redirected there in five seconds.
Alternatively, you can visit the Main Page or read more information about this type of error.

(In reply to comment #3)

Clicking on the non-hyphenated ISBN, however, results in a failed attempt to
go
directly to the ISBN search page, with this resulting error:

Error
404 – File not found
http://en.wikipedia.org/Special:BookSources/9781234567890
We could not find the above page on our servers.
Did you mean to type
http://en.wikipedia.org/wiki/Special:BookSources/9781234567890? You will be
automatically redirected there in five seconds.
Alternatively, you can visit the Main Page or read more information about
this
type of error.

The incorrect URI is bug 48915 (it's even worse for non-English wikis as it always suggests a page on en.wp). Although I presume what is wanted is for the ISBN to be edited rather than taking you to the ISBN search page? If so then getting to that page from a right click/ctrl+click would potentially be useful.

Magic links are pretty evil. Explicitly marking links with a parser function is much more sensible. I'm not sure supporting magic links in VisualEditor is a good idea.

(In reply to comment #5)

Magic links are pretty evil.

They are one of many unusual pieces of wiki syntax. And it is quite 'wikipedia' specific functionality which could be dropped from core.

Explicitly marking links with a parser function
is
much more sensible.

If the goal is to replace them with a more standard syntax, a 'isbn' interwiki pointing to special:booksources/$1 would be syntax that is more similar and conceptually closer also. Ideally it would render as an internal link when the interwiki points to the local special page.

I'm not sure supporting magic links in VisualEditor is a
good idea.

What is the impact of not supporting these magic links on a) big wikipedias like enwp where these magic works will often be used from a cite template (which can be changed without editing millions of pages) and b) small wikis which are imo more likely to use these magic words in raw wikitext.
I.e. How many bot edits are needed, and how many tools need to be revised.

  • Bug 52241 has been marked as a duplicate of this bug. ***
Jdforrester-WMF lowered the priority of this task from High to Medium.Jan 9 2015, 10:55 PM
Jdforrester-WMF renamed this task from VisualEditor: Automatically recognise bare links and magic links (ISBN/etc.), and display as a link to Automatically recognise bare links and magic links (ISBN/etc.), and display as a link.Apr 8 2015, 3:23 PM
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF edited a custom field.
Jdforrester-WMF updated the task description. (Show Details)

T107433 (merged as a dupe here) seems to be a major source of nowikis on frwiki as per https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:%C3%89diteurVisuel/Avis/Nowiki

In Hebrew as well.

Autolink when typing has been merged. Autolink after pasting is in review, but the functionality is complete.

Typed and pasted URLs are now merged in core.

*Pasted* RFC/PMID/ISBN links is implemented (https://gerrit.wikimedia.org/r/230146 is in review).

Currently missing: *typed* RFC/PMID/ISBN links are not autolinked.

Change 230146 had a related patch set uploaded (by Jforrester):
Detect paste of wikitext and convert it

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

Change 230146 merged by jenkins-bot:
Detect paste of wikitext and convert it

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