Page MenuHomePhabricator

nowiki link-like strings that aren't in <a>s
Closed, DuplicatePublic0 Estimated Story Points

Description

<code><nowiki>http://mediawiki.org</nowiki></code>

The <nowiki>s here cause the result to not be automatically linked, but when you edit this in VE (for example, to change http to https) the nowikis disappear and it becomes an actual link

Event Timeline

Krenair created this task.Jun 22 2015, 3:57 PM
Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair added a project: Parsoid.
Krenair added a subscriber: Krenair.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 22 2015, 3:57 PM
cscott added a subscriber: cscott.Jun 22 2015, 5:22 PM

(01:05:51 PM) cscott-free: <p><nowiki>http://example.com</nowiki></p> becomes wikitext http://example.com/foo if the text is edited (to add foo, say), and then WTS doesn't recognize that PHP will auto-link-ify this string.
(01:06:00 PM) cscott-free: so the <nowiki> effectively disappears
(01:06:24 PM) cscott-free: it seems like our selser parsertests should have caught this?
(01:06:59 PM) cscott-free: i wonder if there's some way to make our tests stronger to identify places where we're not nowiki-ing effectively.
(01:07:23 PM) arlolra: λ (master) echo "<p>http://test.com</p>" | node parse --html2html --normalize
(01:07:23 PM) arlolra: <p><a href="http://test.com">http://test.com</a></p>
(01:07:25 PM) cscott-free: maybe the selser tests already catch this, and it's just one of the many things on our blacklist :(
(01:07:26 PM) arlolra: i see
(01:07:42 PM) cscott-free: html2html should catch it, even.
(01:07:44 PM) cscott-free: yeah.
(01:08:10 PM) cscott-free: anyway, i'll look at fixing it. i just wanted to pick your brain about how we could better catch these in testing. somehow.
(01:08:31 PM) cscott-free: but maybe i should check first to see if we're actually already "catching it in testing" and it just ended up on the blacklist
(01:09:54 PM) arlolra: hmm, yeah, that's a good thing to think about
(01:10:31 PM) arlolra: not sure if you've followed the "global <nowiki> cleanup" discussion
(01:13:17 PM) arlolra: but we really need to be mindful about inserting nowikis
(01:13:37 PM) arlolra: cscott: my question there though, is how did the nowikis in the bug report get lost?
(01:13:47 PM) arlolra: cause i'm pretty sure we'd roundtrip them fine
(01:14:32 PM) cscott-free: i'll have to check, I bet VE removed them when the content was edited.
(01:17:13 PM) arlolra: that makes sense
(01:17:32 PM) arlolra: and then rely on parsoid to put them back where necessary

cscott set Security to None.
cscott added a subscriber: Jdforrester-WMF.

I think this might actually be a VE bug.

That is, I think the behavior where the user types http://example.com into VE without explicitly linking it, saves the page, and has that turn into a wikitext autolink is a *feature*. Isn't it?

It certainly is hard to actually make http://example.com into a "proper" link in VE, if that's what you're meant to do. Highlighting it and clicking "link" doesn't autopopulate any of the fields properly.

Yes, there's a bug in VE about auto-linking "http://foo.com" and "ISBN 123456789X" and so on, but that's a client-side decision.

@Jdforrester-WMF could you dig up that bug to link here?

To clarify: you're okay with us "fixing" this "feature" in Parsoid so that typing http://example.com will produce the wikitext <nowiki>http://example.com</nowiki> (and similarly for RFCs, ISBNs, etc), with the idea that VE should really be doing the auto-linking itself?

I'm fine with that, it certainly makes Parsoid round-trip better. I'm just pointing out that it will be seen as a regression until the corresponding VE feature is implemented. Perhaps we should have this task be blocked by that one?

Change 219869 had a related patch set uploaded (by Cscott):
WIP: T103364: Edited autolink-like text becomes an autolink.

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

Arlolra triaged this task as High priority.Jul 7 2015, 2:30 AM
Arlolra added a subscriber: Arlolra.
Arlolra moved this task from Needs Triage to In Progress on the Parsoid board.Jul 7 2015, 3:17 AM
cscott added a comment.Jul 8 2015, 9:47 PM

ok, working patch uploaded to gerrit.

Change 219869 merged by jenkins-bot:
T103364: Edited autolink-like text becomes an autolink.

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

cscott closed this task as Resolved.Jul 10 2015, 2:44 AM
cscott claimed this task.
Jdforrester-WMF edited a custom field.Aug 5 2015, 1:38 AM