Page MenuHomePhabricator

wikilinks with multiple colons but valid namespace render incorrectly
Open, Needs TriagePublicBUG REPORT

Description

Steps to Reproduce: enter a wiki link with a valid namespace, but more than one ":". For example:

[[link 1]], [[xx:link 2]], [[xx::link3]], [[wp::link4]], [[wpx::link5]], [[wp:::link6]], [[wpx:::link7]]

Actual Results:
The above renders as:

link 1, xx:link 2, xx::link3, [[wp::link4]], wpx::link5, [[wp:::link6]], wpx:::link7

Except they're all redlinks, but I don't know how to reproduce color in phab markup. There's a working example in my sandbox on enwiki.

Expected Results:

They should all show up as redlinks. Note, this only happens if the namespace is a valid namespace. An invalid namespace followed by multiple colons renders as a redlink.

Event Timeline

DannyS712 added a subscriber: DannyS712.

@RoySmith this doesn't appear to be a bug

Linknamespacetitleresult
[[link 1]]main/0link 1valid link
[[xx:link 2]]main/0xx:link 2valid link
[[xx::link3]]main/0xx::link3valid link
[[wp::link4]]wikipedia/4:link4invalid link, since :link4 is not a valid title
[[wpx::link5]]main/0wpx::link5valid link
[[wp:::link6]]wikipedia/4::link6invalid link, since ::link6 is not a valid title
[[wpx:::link7]]main/0wpx:::link7valid link

If you tried to navigate to wp::link4 in your browser, you would be shown the error that the title starts with a colon (title-invalid-leading-colon)

They should all show up as redlinks

Only valid link targets should be rendered as links

An invalid namespace followed by multiple colons renders as a redlink

This is because the link target page is in the main namespace, and colons are allowed after the first character. This doesn't always result in a redlink, eg [[NASDAQ:IBM]] is a valid link that links to an existing redirect on enwiki (see demo)