Page MenuHomePhabricator

Inserting link to category adds colon before the link
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce:

  1. Open a page for editing in VE/NWE.
  2. Click the link tool, type "Category:F", and insert a suggestion.

Expected: [[:Category:Foo]]
Actual: : [[:Category:Foo]]

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF changed the task status from Open to Stalled.Mar 21 2017, 7:05 PM
Jdforrester-WMF subscribed.

The link tool is for making links. The tool is doing the correct thing here, preventing you from accidentally adding the page to a category when you mean to link to it. (The same is true for File: namespace pages, for instance.) We don't currently have a category editing tool for NWE, but I expect post-MCR we will be able to split meta-data into a JSON blob outside of wikitext, at which point we could provide the same meta-data dialog that we can offer in VE.

Do you think this task should be Declined and a new one to do that opened, or something else?

@Jdforrester-WMF I think @Schnark has got a different problem. The colon is according to him included before the whole link too, which he says is a wrong behavior

As Dvorapa said, the colon before the title is exactly what's expected. But the tool also inserts an additional colon before the whole link. This additional colon shouldn't be there.

Esanders renamed this task from Inserting link to category in NWE adds colon before the link to Inserting link to category adds colon before the link.Mar 23 2017, 12:43 PM
Esanders updated the task description. (Show Details)
Esanders subscribed.

This isn't specific to NWE. In visual mode you get <a ...>:Category:Book</a>, so the extra colon is the correct based on what the tool is generating. If we fix the visual mode tool this will get fixed too.

Change 344375 had a related patch set uploaded (by Esanders):
[mediawiki/extensions/VisualEditor@master] Use original title or normalized title when inserting link text

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

Jdforrester-WMF changed the task status from Stalled to Open.Mar 23 2017, 3:37 PM

@Jdforrester-WMF I think @Schnark has got a different problem. The colon is according to him included before the whole link too, which he says is a wrong behavior

Ah, yes, you're right.

Jdforrester-WMF set the point value for this task to 1.

This isn't specific to NWE. In visual mode you get <a ...>:Category:Book</a>, so the extra colon is the correct based on what the tool is generating. If we fix the visual mode tool this will get fixed too.

But in visual mode the colon at least is inserted inside the label, while in NWE it's outside the link. While the visual-mode-behavior could be seen as correct (though not really desired) behavior, the NWE-behavior is just wrong,

Change 344375 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Use original title or normalized title when inserting link text

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

Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as Medium priority.