VisualEditor: A link can span whitespace but won't be displayed so cannot be edited or noticed
OpenPublic

Description

Take a two-word link (e.g. [[Example link]]). Use the VE inspector to select "Example" and press the remove-formatting button. Repeat with "link". Now the text is "Example <a href='...'> </a> link", which is illegal wikitext, and renders as if there's no link there.


Version: unspecified
Severity: normal

bzimport set Reference to bz37835.
Jdforrester-WMF created this task.Via LegacyJun 22 2012, 6:07 PM
Jdforrester-WMF added a comment.Via ConduitJun 22 2012, 10:05 PM

Mass-moving items into VisualEditor product

Krinkle added a comment.Via ConduitOct 1 2012, 10:58 PM

(In reply to comment #0)

"Example <a href='...'> </a> link", which is illegal wikitext.

... because [[Foo| ]] will trigger the pipe-trick and turn it into [[Foo|Foo]].

Krinkle added a comment.Via ConduitOct 1 2012, 11:02 PM

(In reply to comment #2)

(In reply to comment #0)
> "Example <a href='...'> </a> link", which is illegal wikitext.

... because [[Foo| ]] will trigger the pipe-trick and turn it into [[Foo|Foo]].

Actually, it doesn't (current master, not using Tidy).

<pre>

  • [[Foo]]
  • [[Foo|]]
  • [[Foo| ]]
  • [[Foo|<nowiki></nowiki>]]
  • [[Foo|<nowiki> </nowiki>]]

</pre>

Expands to:

  • [[Foo]]
  • [[Foo|Foo]]
  • [[Foo| ]]
  • [[Foo|<nowiki></nowiki>]]
  • [[Foo|<nowiki> </nowiki>]]

Renders as:

<ul><li> <a href="/wm-git/mediawiki/alpha/index.php/Foo" title="Foo">Foo</a>
</li><li> <a href="/wm-git/mediawiki/alpha/index.php/Foo" title="Foo">Foo</a>
</li><li> <a href="/wm-git/mediawiki/alpha/index.php/Foo" title="Foo"> </a>
</li><li> <a href="/wm-git/mediawiki/alpha/index.php/Foo" title="Foo"></a>
</li><li> <a href="/wm-git/mediawiki/alpha/index.php/Foo" title="Foo"> </a>
</li></ul>

Which means a loose space works, and with <nowiki> it even works when empty. Good news :)

Catrope added a comment.Via ConduitMar 22 2013, 9:19 PM

<a> </a> doesn't actually render as a clickable link in Firefox. Even if you set text-decoration:underline; on it, it still doesn't render and can't be clicked. However, <a>&nbsp;</a> does behave "correctly".

We probably shouldn't allow users to create whitespace-only links, because they don't render correctly in HTML let alone wikitext. I'm going to work on a change that strips whitespace-only links in the converter.

Catrope added a comment.Via ConduitMar 28 2013, 1:20 AM

(In reply to comment #4)

We probably shouldn't allow users to create whitespace-only links, because
they
don't render correctly in HTML let alone wikitext. I'm going to work on a
change that strips whitespace-only links in the converter.

This part depends on bug 46464.

Jdforrester-WMF added a comment.Via ConduitApr 16 2013, 7:40 PM

Pulling from this milestone as it's a lot of work for a small feature.

gerritbot added a comment.Via ConduitJul 16 2013, 10:47 PM

Change 74084 had a related patch set uploaded by Catrope:
[WIP] Unwrap whitespace-only links

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

Thryduulf added a comment.Via ConduitJul 17 2013, 1:04 PM

I don't know if it is related to this bug, but it is no longer possible to select only part of a link. Previously you could unlink the second word separately for example. See also bug 51531 and bug 50945

Jdforrester-WMF added a comment.Via ConduitJul 26 2013, 10:58 PM
  • Bug 51877 has been marked as a duplicate of this bug. ***
Elitre added a comment.Via ConduitAug 29 2013, 9:59 AM

Just FYI, we have a user at en.wp stating <<I was going to give examples of what turns out to be bug 37835. As the bug is a year old, looks like this won't be fixed and therefore no use in giving the examples.>> :/

Jdforrester-WMF added a comment.Via ConduitSep 25 2013, 1:20 AM
  • Bug 54266 has been marked as a duplicate of this bug. ***
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 4:20 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.