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.
Description
Details
- Reference
- bz37835
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T39835 A link can span whitespace but won't be displayed, so cannot be edited or noticed | |||
Resolved | Catrope | T48464 VisualEditor: Annotation API fixes | |||
Resolved | Catrope | T54037 Strip annotations (e.g. bold, italics, link) from terminal whitespace |
Event Timeline
(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> </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.
Change 74084 had a related patch set uploaded by Catrope:
[WIP] Unwrap whitespace-only links
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
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.>> :/
There's also the situation with nowiki surrounded by bold or italic formatting: [[2008|''<nowiki/>'']] in this edit.