Page MenuHomePhabricator

URLs containing quotation marks create broken links, and VisualEditor should fix them
Closed, InvalidPublic

Description

Current situation:

  • Paste something like https://www.google.com/search?q="test+Google+search" into one of the old wikitext editors.
  • Oh, right, the quotation marks. Where's that page that explains how to fix the quotation marks...
  • Never mind. I shouldn't have to look up ASCII codes to put a link on the page. VisualEditor ought to do that magic for me. Open VisualEditor (visual mode).
  • Paste in the URL.
  • That didn't work either! Argh!
  • Okay, let's do this the serious way: Open the link dialog, paste the URL in the box, insert the link, get the link marked as [1], which is not what I want, open the link dialog *again*, and click 'add a label' to get rid of the [1] and just have the plain link.
  • Finally! It worked! (See picture.)
  • Save the page.
  • Arrggghghhh! (See picture.)

It looks like it's worked just before saving:

Screen Shot 2017-08-02 at 10.08.11 AM.png (379×540 px, 70 KB)

But the saved page is just as broken as the link would be in the old wikitext editors:

Screen Shot 2017-08-02 at 10.08.28 AM.png (314×533 px, 64 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Funnily enough, I can't get it to break in the exact way yours is, with the link being split in half. Mine just goes to bad quote encoding instead:

image.png (220×1 px, 36 KB)

VE sends:

<a href="https://www.google.com/search?q=&#x22;test+Google+search&#x22;" rel="mw:ExtLink">https://www.google.com/search?q=&#x22;test+Google+search&#x22;</a>

Which Parsoid serializes to

https://www.google.com/search?q=&#x22;test+Google+search&#x22;

I would thus assume that for whatever (probably browser-related) reason, yours is sending the quotes not encoded in any way, and Parsoid is still following the exact same href-is-label rule even in a case where the auto-linker won't actually link the whole thing.

Deskana subscribed.

This seems to be working fine for me in the visual editor; I pasted the link in, saved, and the link is still functional. This worked in Chrome, Safari, and Firefox. The 2017 wikitext editor is as broken as the 2010 editor.

I see the bad encoding like David which, whilst being suboptimal because the user's input seemingly changes, is only a cosmetic problem since the link otherwise functions exactly as you'd expect.

Test page: https://en.wikipedia.org/wiki/User:Deskana_(WMF)/sandbox/encoding

I'm closing this as invalid since both David and I cannot reproduce.