Page MenuHomePhabricator

Diffusion uses insufficient color coding for Less files (fixed in Pygments 2.8.0 version in Debian Bookworm)
Open, Stalled, LowestPublic

Description

Phabricator's Diffusion is currently handling the Less color coding incorrectly:
https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/src/mediawiki.ui/components/buttons.less;6960b650ea22607b3901dbb33fb49e3015613df3

Single-line comments (//) are colored using class n and o and look different than a code block using /* */

phabricator_pygments_less_comments.png (199×922 px, 45 KB)

Event Timeline

Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald Transcript
Paladox added a revision: Restricted Differential Revision.Nov 15 2016, 8:31 AM

Change 321721 had a related patch set uploaded (by Paladox):
Phabricator: Add a few more languages to pygments dropdown box

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

Paladox removed a revision: Restricted Differential Revision.Nov 15 2016, 8:23 PM

Change 321721 merged by Dzahn:
Phabricator: Add a few more languages to pygments dropdown box

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

@Volker_E how does it not look correctly. It's now supported in https://gerrit.wikimedia.org/r/#/c/321721/5/modules/phabricator/data/fixed_settings.yaml

Unless it's because we did LESS instead of Less.

Or it might be fallbacking onto the php version

pygments may not be installed if it is using the php version.

@mmodell is pygments installed on production phabricator?

@Paladox The difference is that you proposed a patch (like with review in Gerrit) AND accepted it yourself. It's the same as +2ing your own commit in Gerrit and not aligned with our principles of code contribution here.
Apart from that I'm happy about the progress on the cause itself.

@Volker_E I meant the less file, I know about the review process.

That's why differential needs to be updated with +1 +2 -1 -2 since anyone can accept it.

Aklapper triaged this task as Lowest priority.May 30 2021, 9:36 AM

// foo should be #74777d (for class c) I guess (like for /* foo */), but ends up #a21 (for class o) and #00702a (for class nt).

https://phabricator.wikimedia.org/config/edit/pygments.enabled/ says Local Config: true. We are on pygmentize 2.3.1.

Per https://github.com/pygments/pygments/issues/1046 this was fixed in https://github.com/pygments/pygments/commit/78d360e3f0d55d92d227b49c67779558f9fa5a14 included in pygmentize 2.8.0.

Upgrading to Debian Bullseye in T334519 won't fix this as it ships 2.7.1. Debian Bookworm would ship 2.14.0.

Aklapper renamed this task from Phabricator Diffusion is using insufficient color coding for Less files to Diffusion uses insufficient color coding for Less files (fixed in Pygments version in Debian Bookworm).Sep 25 2023, 6:52 PM
Aklapper changed the task status from Open to Stalled.

(The link in the description is not available anymore)

Funnily, we had T276298 which was to upgrade pygments for SyntaxHighlight and was targetting Buster. That apparently never got used.

Aklapper renamed this task from Diffusion uses insufficient color coding for Less files (fixed in Pygments version in Debian Bookworm) to Diffusion uses insufficient color coding for Less files (fixed in Pygments 2.8.0 version in Debian Bookworm).May 20 2024, 1:42 PM
Aklapper removed a subscriber: gerritbot.