Page MenuHomePhabricator

SyntaxHighlight GeSHi should use mw-code class
Closed, DeclinedPublic

Description

The contents of a page in the Module: namespace are wrapped in a <pre> tag with the classes lua source-lua. That <pre> tag should also have the class mw-code so it can take advantage of any CSS rules applied to system-generated <pre> tags, such as the one I've proposed in T59824.


See also:
T59824: Display tabs in .mw-code as 4 spaces using CSS tab-size property.

Details

Reference
bz57825

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:35 AM
bzimport added a project: SyntaxHighlight.
bzimport set Reference to bz57825.
bzimport added a subscriber: Unknown Object (MLST).

Scribunto does use mw-code when generating <pre> tags itself.

When using SyntaxHighlight_GeSHi, the <pre> is generated by that extension and Scribunto has no control over it.

Makes sense. But there is still a bug to be fixed, only it's in SyntaxHighlight GeSHi rather than Scribunto.

Why not for .js and .css pages too? No reason at all to limit this to just Scribunto modules.

Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
Krinkle claimed this task.
Krinkle subscribed.

The extension now always uses <pre> or <code> which is styled by MediaWiki the same way as custom elements with mw-code. Adding the class name is superfluous and is actually non-trivial due to the html being generated by an upstream library.

After the switch to Pygments, the duplication of styles has been resolved. It now blends in with whatever styles MediaWiki apply to <pre> in general.