Page MenuHomePhabricator

Bare unlinked URLs added "manually" via the Cite tool get intentionally <nowiki>'d by Parsoid
Closed, ResolvedPublic8 Estimated Story Points

Description

This is a side-effect of T103364, but it's always been a bug technically speaking: if you enter a URL into the 'manual' field in the citation tool, Visual Editor gives it to Parsoid as plain text, which means that Parsoid obediently adds <nowiki> tags to ensure that it doesn't accidentally get autolinked.

There's are other issues with autolinking, but handling this one case correctly will help resolve https://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#External_links_in_references_put_in_nowiki_tags

Event Timeline

cscott raised the priority of this task from to Needs Triage.
cscott updated the task description. (Show Details)
cscott added a project: VisualEditor.
cscott subscribed.

What do you mean by the manual field? There's a manual tab in citoid...

This is a big problem for wikis which do not have any citation templates set up: there is only the "basic" option for citations, which shows you a text box, and if you paste an URL there, it won't work. It's very counterintuitive.

Jdforrester-WMF renamed this task from URLs added "manually" via the Cite tool get <nowiki>'d to Bare unlinked URLs added "manually" via the Cite tool get intentionally <nowiki>'d by Parsoid.Aug 4 2015, 7:16 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF set Security to None.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.

So there are two problems:

  1. People pasting into basic instead of Citoid - this seems like a user education problem. I'm surprised it's happening at all given the first box we show you is Citoid.
  2. Wikis which don't have Citoid.

For 2 I think the ideal solution is to find a way to give them Citoid. If it's impossible for them to create citation templates, then we can have a fallback which generates some sensible output based on parameters which are universal to all references (title/url?).

It seems to be mostly "power users" who "know how to add refs".

I think (1) adding proper autolink support to VE (is there a phab ticket for that?) will help a lot. I'm working on patches for that.

@Esanders also mentioned (2) a DataTransferHandler for paste that would detect wikitext (and bare links) and wiki-fy them before pasting (just feed them through wt2html in parsoid). That would also help a lot in general with our <nowiki>s, a bunch of which seem to be caused by pasting wikitext into VE.

The last bit is people manually typing a URL into the manual cite field. VE autolinks (as in google docs, etc) will happen on the first whitespace after a link, so it's possible if you just type the URL and close the dialog you'll still get an unlinked (nowiki'ed) URL. There might be (3) some sort of hack we can play where we invoke autolinking on dialog close or something like that. Let's do (1) and (2) first and see whether we really need (3).

https://gerrit.wikimedia.org/r/230145 addresses (1) -- autolink support in VE.
https://gerrit.wikimedia.org/r/230146 addresses (2) -- paste of wikitext.

Change 231145 had a related patch set uploaded (by Cscott):
Autolink pasted links

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

VE patches to autolink URLs when typing have landed (e17415501bf18ca55b8b4fdffb1f1e055f7aaa3a).

Still in the review queue are the patches to autolink pasted URLs (https://gerrit.wikimedia.org/r/231145 and related pull-through patch https://gerrit.wikimedia.org/r/231156). These are the patches which I expect will actually address the issue discussed here, pasted URLs in citations.

Change 231145 merged by jenkins-bot:
Autolink pasted links

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