10

I'm not quite sure what Prettify was doing before, but now questions seem to be getting highlighted in a pretty random set of choices. For an example, https://stackoverflow.com/revisions/64192481/1 is a question where the embedded code is now being highlighted entirely wrongly as Typescript and C#, neither of which is even remotely correct in visual appearance (critically in this question, the comments are not being highlighted as such); I “fixed” it by forcing the highlighting language to bash but that's wrong (it's a language that has nothing to do with the question) so I don't see it as a “fix” that should be encouraged at all.

Now, I know that highlight.js supports Tcl — I can see a correct example on their demo page — so the failure is definitely not an upstream problem. (The other tag on the question definitely doesn't have a highlighter.)


There's got to be many other languages in the “long tail” of questions on this site that suffer from similar problems. I definitely can't list them all. But any sane solution to this needs to be not just for one language not currently on the blessed list; that's just kicking the ball slightly further down the road.

Or if that can't be done, can we at least not have utterly wrong highlighting schemes being applied? They're actively misleading right now, making it harder to read questions and answers.

4
  • I'm not sure if this is a bug or a FR. It's on the fun boundary between the two… Commented Oct 4, 2020 at 12:09
  • Probably something very like meta.stackexchange.com/questions/354555/…
    – muru
    Commented Oct 4, 2020 at 14:06
  • 1
    TCL is (intentionally?) currently not included in the list of languages SO supports. It's included in Highlight.js, but they are choosing not to load that grammar - so I imagine you're just seeing auto-detect do a poor job since it's not ever given an opportunity to decide if it might be TCL or not. Agree: It's definitely worth a discussion on how to prevent highlighting at all for languages that SO purposely chooses not to support rather than just picking some random language and doing a terrible job. Although I'm not sure how to do that unless SO just block-listed some tags. Commented Oct 17, 2020 at 21:09
  • 1
    @DonalFellows I wrote a Chrome extension that adds support for every single language Highlight.js supports if that might prove helpful. It currently only kicks in if those languages are manually hinted ie, ```tcl, etc., but adding auto-hint support based on question tags is on the list. So just seeing the post is tagged tcl could trigger TCL to be used for highlighting. I'm hoping some others will contribute. github.com/joshgoebel/se_highlightjs Commented Oct 29, 2020 at 12:27

0

You must log in to answer this question.

Browse other questions tagged .