Page MenuHomePhabricator

A link can span whitespace but won't be displayed, so cannot be edited or noticed
Open, LowPublic40 Estimated Story Points

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.

Details

Reference
bz37835

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:29 AM
bzimport set Reference to bz37835.

Mass-moving items into VisualEditor product

(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]].

(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 :)

<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.

(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.

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

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

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

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

  • Bug 51877 has been marked as a duplicate of this bug. ***

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.>> :/

  • Bug 54266 has been marked as a duplicate of this bug. ***

There's also the situation with nowiki surrounded by bold or italic formatting: [[2008|''<nowiki/>'']] in this edit.

There's also the situation with nowiki surrounded by bold or italic formatting: [[2008|''<nowiki/>'']] in this edit.

T95730: Link with <nowiki/> as only label.

Jdforrester-WMF renamed this task from VisualEditor: A link can span whitespace but won't be displayed so cannot be edited or noticed to A link can span whitespace but won't be displayed, so cannot be edited or noticed.Jun 14 2016, 12:02 PM
Jdforrester-WMF added a project: Design.
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF set the point value for this task to 40.
Jdforrester-WMF set Security to None.
Mmm1100 raised the priority of this task from Low to Medium.Dec 27 2022, 3:01 PM
Mmm1100 set Due Date to Dec 26 2022, 8:30 PM.
Aklapper lowered the priority of this task from Medium to Low.Dec 27 2022, 7:46 PM