Page MenuHomePhabricator

Find a solution for Parsoid read views on projects that prefer `1` over `[1]`
Closed, ResolvedPublicBUG REPORT

Description

Some projects seem to prefer their footnotes to be displayed without the square brackets. These projects addressed that need with a CSS workround for Parsoid the we needed to remove to fix T370512: Some wikis append a 0 (zero) after every reference/footnote in VisualEditor (due to local CSS). Now the square brackets are visible in the Parsoid read output.

See https://fr.wikipedia.org/wiki/Tr%C3%A9voux?useparsoid=1 vs https://fr.wikipedia.org/wiki/Tr%C3%A9voux?useparsoid=0

Notes:

  • T369614: Parsoid: explicit numbering for footnote markers might be related
  • These projects seem to have introduced overrides for the i18n message that's used to compose the footnote link including the brackets [1]. There the brackets are wrapped in HTML elements with CSS classes that can be used as selectors to hide the brackets. Like for example in this patch [2].

[1] https://fr.wikipedia.org/w/index.php?title=MediaWiki:Cite_reference_link&action=edit
[2] https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1056448

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Here's the current recommendation for CSS to suppress or hide square brackets: https://phabricator.wikimedia.org/T370512#10213456

It would be great if Parsoid could use the same mechanism for now, of wrapping the bracket character in <span class="cite-bracket">.

In the future, I hope we can add a "community configuration" setting which prevents generation of the brackets in the first place...

I hope we can add a "community configuration" setting which prevents generation of the brackets in the first place...

I think it's possible to argue that this is about how footnote markers visually appear, and conclude that everything related to that should be done with CSS, not via configuration. Similar to making the footnote markers bold, for example. This should also be done with CSS and not by adding <b> (which is what's still done in many places for historical reasons).

Note: In my detailed investigation in T335129#9631804 I found that 4 wikis currently remove the square brackets, and 9 more wikis wrap them in <span> (some to hide them via CSS, others to style them a little bit). This possibly means that the wikis that need this as a feature are only a few more obscure, smaller ones, and we shouldn't invest to much resources here. Giving them an option to add a line to their global CSS should be enough, in my opinion.

Here's the current recommendation for CSS to suppress or hide square brackets: https://phabricator.wikimedia.org/T370512#10213456

It would be great if Parsoid could use the same mechanism for now, of wrapping the bracket character in <span class="cite-bracket">.

Note that CIte's Parsoid implementation doesn't do this currently -- so this will need to be implemented before the CSS fix can apply to Parsoid HTML.

Here's the current recommendation for CSS to suppress or hide square brackets: https://phabricator.wikimedia.org/T370512#10213456

It would be great if Parsoid could use the same mechanism for now, of wrapping the bracket character in <span class="cite-bracket">.

Note that CIte's Parsoid implementation doesn't do this currently -- so this will need to be implemented before the CSS fix can apply to Parsoid HTML.

Patch to add that is https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/1082732

Change #1082732 had a related patch set uploaded (by WMDE-Fisch; author: Awight):

[mediawiki/extensions/Cite@master] Parsoid: configurable .cite-bracket square brackets

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

Change #1082732 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Parsoid: configurable .cite-bracket square brackets

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

Draft for User-notice:

Very few wikis (e.g. French and Spanish Wikipedia) hide the square brackets around footnote markers. Instead of [1] readers see only a 1. We ask these communities to either revisit their decision and come back to the default, signature rendering used by all other wikis or update their customization to use CSS as described here. The old way to customize this never worked in VisualEditor and the new parser.

Slight changes to that text :-)

Interface administrators on wikis that hide brackets around footnotes should update these customization. Currently some projects use CSS and a custom cite_reference_link MediaWiki message to hide brackets. These projects should adjust their CSS rules as described here. The new parser and VisualEditor do not work with the deprecated customization. Ideally admins should revert the message to it's default for best compatibility.

Slight changes to that text :-)

Interface administrators on wikis that hide brackets around footnotes should update these customization. Currently some projects use CSS and a custom cite_reference_link MediaWiki message to hide brackets. These projects should adjust their CSS rules as described here. The new parser and VisualEditor do not work with the deprecated customization. Ideally admins should revert the message to it's default for best compatibility.

Ping @Quiddity to look at the draft in my last comment already. We might add the text next week for the issue that follows that week. ;-)

Moved the discussion around the communication to the existing subtask

WMDE-Fisch closed this task as Resolved.EditedApr 7 2025, 10:40 AM

All done. Communities used changed the i18n message now switched to the provided CSS class for customize bracket styling. With these changes brackets style the same in legacy, Parsoid and VE rendering.

Also the customization of the cite_reference_link i18n is now reduced to almost zero. We're pretty close on getting that message key removed eventually.