Topic on Project:Support desk

Bug? Wikieditor Fails To Include Leading Colon For Category-links

10
Johnywhy (talkcontribs)

A page source contains:

can be found [[Category:Rebuttal Deep-Dives|here]].

it previews as:

can be found .

after submitting the edit, the link is lost, and the wikitext source looks like:

can be found .

I disabled common.js with the following, but that didn't fix it:

$wgUseSiteJs = false;

I ran with verbose error-reporting with the following, and did not get any errors:

error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgShowSQLErrors = true;
197.218.88.186 (talkcontribs)
Johnywhy (talkcontribs)

The page you linked does not mention syntax for categories, mr pebcak.

However, this other page (which would have been better for you to link to) shows the need for a leading colon:

[[:Category:Rebuttal Deep-Dives|here]]

i'm creating the link using the WikiEditor toolbar-- the syntax should be correct, but it's not. Therefor, this appears to be a bug with the WikiEditor toolbar. It fails to include the leading colon when linking to a category. It should.

Reported https://phabricator.wikimedia.org/T198746

Whether it makes sense for MW to ERASE bad-links, instead of just leaving them alone, is a separate question. I think MW should just leave them alone, not erase them as it currently does.

197.218.88.186 (talkcontribs)
197.218.88.186 (talkcontribs)
> Whether it makes sense for MW to ERASE bad-links, instead of just leaving them alone, is a separate question. I think MW should just leave them alone, not erase them as it currently does.

It is not a bad link, anymore than typing or doing the same with [[en:boo]].

Johnywhy (talkcontribs)

> not a bad link

What i'm seeing is: MW erases the brackets and everything between them, when leading colon is missing on a Category link.

Are you seeing something different?

> might as well be a feature

A bug is a bug, even if 197.218.88.186 is used to it.

197.218.88.186 (talkcontribs)

Yes, because that's also the syntax for categorizing a page. Strictly speaking it DOES create a link. It just doesn't appear where you expect it to be (see bottom of the page). The markup in my previous post does a similar thing. You can also do something similar with :

[[fooo|<span style="display:none"]]

Even that can be done with the wikieditor.

Johnywhy (talkcontribs)

no closing angle-bracket needed for the span?

[[fooo|<span style="display:none"]]
Johnywhy (talkcontribs)

You were correct: originally, i misunderstood the bug due to a bit of pebcak :D

Johnywhy (talkcontribs)

Yep, you're right. My intended link-text parameter is treated as a sort-key by MW.

[[Category:Rebuttal Deep-Dives|here]]

"here" puts the page under "H" in the category page-list.

Help:Categories#Sort key

Reply to "Bug? Wikieditor Fails To Include Leading Colon For Category-links"