Page MenuHomePhabricator

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



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 raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair added a project: Parsoid.
Krenair subscribed.

(01:05:51 PM) cscott-free: <p><nowiki></nowiki></p> becomes wikitext 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></p>" | node parse --html2html --normalize
(01:07:23 PM) arlolra: <p><a href=""></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 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 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 "" 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 will produce the wikitext <nowiki></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.

Arlolra triaged this task as High priority.Jul 7 2015, 2:30 AM
Arlolra subscribed.

ok, working patch uploaded to gerrit.

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