Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

52
  • 61
    Good to see that the Teams devs are also bringing features to the public network!
    – Luuklag
    Commented Sep 8, 2020 at 18:40
  • 13
    I have some updating to do then, for example on this one: What is the default language for the syntax highlighter? ...
    – rene
    Commented Sep 8, 2020 at 18:56
  • 5
    @rene I have a (incomplete, I'm sure) list of posts that need updating after this goes live. I'll add this one to the list. Thanks for bringing it to my attention
    – Ben Kelly StaffMod
    Commented Sep 8, 2020 at 19:04
  • 7
    I hope the syntax highlighting FAQs (both here and on MSO) are part of that list as well. Commented Sep 8, 2020 at 19:18
  • 2
    @SonictheMaskedWerehog Yup, they both are! Thanks for checking in though. Better safe than sorry with those posts since they're the "source of truth" for this feature.
    – Ben Kelly StaffMod
    Commented Sep 8, 2020 at 19:29
  • 13
    How badly does it choke when asked to highlight the omni-glot? (Yes, that's a single piece of code that's a different valid program in each of 294 languages.)
    – Mark
    Commented Sep 8, 2020 at 20:08
  • 10
    @Mark Honestly, not too bad. Speed was (visually, didn't actually benchmark it) comparable to my test page that had ~16 different languages on it. For the curious, the autohighlight detection marked that code snippet as bash.
    – Ben Kelly StaffMod
    Commented Sep 8, 2020 at 20:25
  • 15
    @SonictheMaskedWerehog why invest resources into something that isn't the core product?
    – Braiam
    Commented Sep 8, 2020 at 22:41
  • 2
    @Braiam I thought SO was their core product. Syntax highlighting is a core part of that. Commented Sep 8, 2020 at 23:03
  • 31
    Q&A is the core product, @Sonic, not syntax highlighters. Syntax highlighting is just a small portion of that, and not in any way critical to the platform's success. It isn't something Stack Overflow needs ownership or control of. Just as you shouldn't develop your own JavaScript framework, you shouldn't develop all your own tools when there's something already out there that does the job well. Commented Sep 9, 2020 at 0:07
  • 4
    Given that highlighting occurs client side, how about a feature that allows the user to specify the highlight.js template(s)? It would be very cool if code on SO looked the same as my IDE. Familiar (color) styling makes code easier to read.
    – Mike
    Commented Sep 9, 2020 at 1:02
  • 6
    Please, ask your questions as answers, as that gives Ben more room to respond individually!
    – Catija
    Commented Sep 9, 2020 at 6:19
  • 13
    Whatever you do, please don't change the line-height for code blocks
    – hkotsubo
    Commented Sep 9, 2020 at 12:53
  • 3
    Don't forget to update this page to mention highlight.js instead of Google Prettify.
    – Clonkex
    Commented Sep 17, 2020 at 1:43
  • 2
    @Clonkex Already good to go! You can see the update on the meta version of that page (happens automatically when turned on). Good looking out though
    – Ben Kelly StaffMod
    Commented Sep 17, 2020 at 19:21