Page MenuHomePhabricator

Cite reference customizations (e.g. hiding square brackets) are ignored in VisualEditor preview
Closed, DuplicatePublic

Description

In preview, CSS settings don't function in preview. For example, in French Wikipedia, cite brackets are disabled in the MediaWiki:Common.css, but in preview they are displayed :

  • In article :
    Capture d’écran 2021-02-09 à 18.47.37.png (571×1 px, 164 KB)
  • In preview :
    Capture d’écran 2021-02-09 à 18.48.04.png (544×1 px, 177 KB)

Event Timeline

Thanks for reaching out Golmore. I've removed the CSS extension tag and added a Cite extension tag.

The MediaWiki:Common.css capability is core to MediaWiki rather than part of the CSS extension. (wikipedia doesn't include the CSS extension)

At a glance, it looks like the issue is related to this system message:
https://fr.wikipedia.org/w/index.php?title=MediaWiki:Cite_reference_link&action=edit

The preview appears to use the default system message:
https://www.mediawiki.org/w/index.php?title=MediaWiki:Cite_reference_link&action=edit

image.png (626×847 px, 89 KB)

While the regular page uses the custom system message:

image.png (619×846 px, 60 KB)

I'm not sure if this is related to the editor/preview function or the Cite extension, but this info might help you narrow it down further.

I removed "cite" ; the task isn't about cites, but about CSS in preview in general, I just used cites as an example.

Izno added a subscriber: Izno.

No, the specific issue is about cite in fact and I believe it's one of the ones already hanging out though I'm not sure which. If you have another issue with CSS elsewhere you should consider filing another task.

Aklapper renamed this task from CSS settings don't function in preview to MediaWiki:Common.css customizations (e.g. hiding Cite's square brackets for refs) are ignored in VisualEditor preview.Feb 10 2021, 10:14 AM

@Golmore: For future reference, it would be welcome if you could follow https://www.mediawiki.org/wiki/How_to_report_a_bug (e.g. including full links and clear steps to reproduce). Thanks a lot :)

Also, the current title of this task is incorrect, MediaWiki:Common.css customizations absolutely will be applied to the new wikitext editor preview. The problem is that the customizations to references are not done via CSS (so the old title of the task was also incorrect), but using localisation messages, as pointed out by the earlier comment here (T274286#6816702) – and Parsoid doesn't support them.

Task T156351 is about adding CSS customizations (either to MediaWiki:Common.css or somewhere in the source code), and that's probably the best way to resolve this.

matmarex renamed this task from MediaWiki:Common.css customizations (e.g. hiding Cite's square brackets for refs) are ignored in VisualEditor preview to Cite reference customizations (e.g. hiding square brackets) are ignored in VisualEditor preview.Feb 10 2021, 10:41 PM