Page MenuHomePhabricator

Templates that only insert categories are completely invisible in VisualEditor
Open, Needs TriagePublicBUG REPORT


Steps to replicate the issue (include links if applicable):

What happens?:

  • There are two templates without any visible content on the page, in between the «chevrons»:
    • {{empty}}, which has the wikitext {{ns:0}}, is shown as a gray box with a puzzle icon
    • {{empty/categoryonly}}, which has the wikitext [[Category:Test]], is completely invisible in VisualEditor.

The HTML for the latter inside VisualEditor is a <link> tag, which is probably not meant to be rendered by browsers by default. I can force it to render by adding display:inline-block; width:1em; height:1em; background:red; in the browser console (in which case the events attached to it work as expected).

I don't have a demonstration available, but the exact same thing happens if the wikitext of {{empty/categoryonly}} is {{ns:0}}[[Category:Test]].

What should have happened instead?:

  • The template that only outputs a category should also have a gray box with a puzzle icon, so that its presence is known to people who use VE, and so that they are able actually click and edit it if necessary.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Screenshot_20231113_231924.png (267×993 px, 34 KB)

I'm adding the Regression tag because I believe this is a regression, but I don't use VE often enough myself to be 100% sure it used to work.