Skip to main content
102 events
when toggle format what by license comment
May 23, 2023 at 4:41 review Close votes
May 23, 2023 at 6:10
Jun 20, 2021 at 14:03 comment added Konrad Rudolph @P.Mort.-forgotClayShirky_q github.com/highlightjs/highlight.js/pull/3251
Jun 20, 2021 at 12:19 comment added This_is_NOT_a_forum @Dave Cousineau: Yes, here is an example I stumbled upon yesterday.
Jan 3, 2021 at 1:46 comment added Dave Cousineau I don't know where to post this and didn't want to make a whole post about it, but the syntax highlighting for C# is pretty poor after this change. I've been stuck a couple times trying to get the syntax highlighting to take effect only to realize that the completely white code was the "syntax highlighting". Other languages (TypeScript) are similar, where almost nothing but keywords are highlighted and everything else is just white; white method names, white variables, white operators, white type names, etc.etc.
Oct 20, 2020 at 21:05 comment added Adam Lear StaffMod @JoshGoebel Thanks, will do.
Oct 20, 2020 at 1:32 comment added Josh Goebel @AdamLear That erlang example looks quite broken... please file an issue on our GitHub and we'd be happy to take a closer look at it.
Oct 20, 2020 at 1:29 comment added Josh Goebel @Ecuador ObjectiveC is a hard one to highlight because it's so dependent on punctuation. [] dispatch syntax, etc... which Highlight.js has traditionally not even tried to highlight (though we're more open to that now). Or you could be seeing any number of issues with SO's specific implementation. There (IMHO) are some serious issues with how they handle conflicting language tags and the version they are using is 10.2.0 while the latest (with many fixes) is 10.3.1. If none of that helps we'd love your help to improve the ObjectiveC grammar if possible. :-)
Oct 14, 2020 at 21:58 answer added zcoop98 timeline score: 7
Oct 10, 2020 at 0:00 history edited CommunityBot
Oct 8, 2020 at 9:48 answer added Konrad Rudolph timeline score: 2
Oct 7, 2020 at 20:49 answer added noslenkwah timeline score: -1
Oct 7, 2020 at 12:38 answer added Erwin Brandstetter timeline score: 3
Oct 6, 2020 at 12:53 answer added JW0914 timeline score: 8
Oct 6, 2020 at 3:41 answer added Anis Ladram timeline score: 5
Oct 5, 2020 at 15:00 comment added Derek Eden I liked how it looked before :D but good to know the devs are responding to the community
Oct 5, 2020 at 10:22 answer added Ecuador timeline score: 4
Oct 5, 2020 at 10:12 comment added Konrad Rudolph @Ecuador Please create a new answer below and tag it as “bug”! (Highlight.js supports Objective-C, Stack Overflow just fails to apply that, it resorts to plain C instead).
Oct 5, 2020 at 9:58 comment added Ecuador Wow, came here after trying to understand why Objective C is unreadable on stack overflow nowadays. I mean, almost everything is plain white - and it's not like there is no definitive style of highlighting Objective C that everybody uses (Xcode...)!
Oct 4, 2020 at 19:15 answer added William Robertson timeline score: 5
Oct 3, 2020 at 17:52 answer added CertainPerformance timeline score: 5
Oct 3, 2020 at 5:39 comment added Tanveer Badar This example is horribly broken in terms of highlight.
Sep 29, 2020 at 20:59 answer added Peter Duniho timeline score: 3
Sep 29, 2020 at 19:22 answer added Antti Haapala timeline score: 22
Sep 28, 2020 at 21:59 comment added Will Ness @BenKelly aha. thanks for this clarification. I thought lang-prolog and prolog were different. --- what I did before was I always used erlang, and it worked well enough. but now that's broken. so, a change for the worst for us in prolog, overall. IOW, progress. :-L //moving on...
Sep 28, 2020 at 21:54 comment added Ben Kelly StaffMod @WillNess I can tell you with confidence that prolog does not work. There's simply no syntax definition loaded for it. You can inspect the dom of the pre element and you can see the language it autohighlights as (added as a class). Any "correct" highlighting you're seeing is coincidental. It didn't work correctly in the past either. When prettify couldn't detect a language, it would highlight literally everything it could as a last-ditch effort. See the Meta.SO announcement for more details on autohighlighting differences.
Sep 28, 2020 at 21:41 comment added Will Ness @BenKelly no, explicit lang-prolog works, but only sometimes. do you really suggest it's alright for the highlighter to switch to something else even when there's an explicit spec of the language on each snippet??? how odd. re bug report, I've burned enough time on this as it is. if you want your site to work properly, you do it. you get the dough for it, I don't, with all due respect.
Sep 28, 2020 at 19:52 comment added Ben Kelly StaffMod @WillNess Prolog is not one of our supported languages, so it'll get autohighlighted to whatever highlight.js thinks the snippet most closely resembles. The erlang issue you note appears to be an upstream issue. I'd recommend filing a bug report.
Sep 28, 2020 at 16:40 answer added Rmano timeline score: 4
Sep 28, 2020 at 14:41 comment added Ben Kelly StaffMod @MartijnPieters Yup! That's on the list for updating today. Thank you for your help! Edit - updated!
Sep 28, 2020 at 14:32 answer added Patrick Artner timeline score: 3
Sep 28, 2020 at 8:33 answer added Larnu timeline score: 6
Sep 28, 2020 at 6:36 comment added Martijn Pieters @BenKelly I’ve partially updated the FAQs as they sorely needed to be in light of new bug reports that need to be directed to highlight.js. Were you still going to update those?
Sep 27, 2020 at 16:36 comment added Will Ness @AdamLear lastly, :) here's "erlang" highlighting -- absolutely erratic, inconsistent within one code block even. compare it with the previous highlighter's beautiful results (search for "CLP" to quickly jump to it there on that page) (the image)
Sep 27, 2020 at 15:01 comment added Will Ness @AdamLear here's yet another example. both code snippets are tagged with prolog, yet look completely different. nothing changes when I change it to lang-prolog, too. the highlighting is completely broken.
Sep 27, 2020 at 0:54 answer added 1201ProgramAlarm timeline score: 4
Sep 26, 2020 at 22:01 comment added Will Ness @AdamLear here's another reference: see these two answers, both on the same question, both have no lang specs whatever, the highlighting half-works on one and doesn't on the other. (re "half-works": % is EOL-comments char in Prolog. yet it looks differently in the different snippets)
Sep 26, 2020 at 21:33 comment added Will Ness @AdamLear take a look at this. all the code snippets are done with code fences with the same lang-prolog specified. yet the highlighting for some looks completely different than for others. this is just supposed to be impossible, isn't it? besides, the highlighting itself is not good at all even when it works, like with the very first snippet there.
Sep 26, 2020 at 19:24 comment added Adam Lear StaffMod @WillNess Looks like the prolog tag on SO specifies "none" for highlighting and "lang-prolog" isn't in the list of options. Not 100% sure how we populate that list off the top of my head, but we'll look into it on Monday. I switched it to "default" for now so that should hopefully help, but please let me know if it somehow makes things worse instead.
Sep 26, 2020 at 16:50 comment added Will Ness it doesn't work at all for the prolog tag on SO unless we specify "lang-prolog" manually, and even then the new highlighter is atrociously erratic. most of the times even "language-all: lang-prolog" doesn't work and one has to re-do all code snippets one by one, some times it's the other way around. for examples, see my recent edits to posts in prolog. no, I won't prepare the brief, I've burned enough time on this as it is. it worked reasonably well before you went on your crusade du jour to fix what wasn't broken in the first place. oh, and "erlang" is completely messed up.
Sep 26, 2020 at 2:02 answer added Dingus timeline score: 3
Sep 25, 2020 at 23:51 answer added camickr timeline score: 3
Sep 25, 2020 at 21:22 answer added David Carlisle timeline score: 12
Sep 25, 2020 at 21:04 comment added David C. Rankin @BenKelly Thank you for checking. However I just looked at another C question and the #include <....> are "baby-puke green" and all functions are "burned orange", strings are the same "baby-puke green", etc.. I just looked at I'm trying to make a diagram of fork() process calls in C. I don't know what to say, but with dark-mode the syntax highlight is horrible. (I have three kids -- I know baby puke green...)
Sep 25, 2020 at 20:34 comment added isagalaev I'm glad it finally happened :-) (P.S. I'd use a different color for .hljs-meta from the one used for keywords.)
Sep 25, 2020 at 19:45 comment added Ben Kelly StaffMod @DavidC.Rankin There was a bug that was causing some conflicting styling on some of our language features. I've fixed it and most languages will now look much better
Sep 25, 2020 at 14:22 answer added Matthew FitzGerald-Chamberlain timeline score: 1
Sep 25, 2020 at 12:09 answer added Larnu timeline score: 18
Sep 25, 2020 at 8:17 answer added kriegaex timeline score: 3
Sep 25, 2020 at 8:07 comment added aepot I suggest to add an alias lang-xaml to lang-xml. It worked before update.
Sep 25, 2020 at 5:27 comment added David C. Rankin Please revert to prettify or fix the colors with google. There is just no diplomatic way to put this -- the new syntax colors for C/C++ syntax hilighting are God-Awful Ugly -- it makes code harder to read.
Sep 25, 2020 at 0:49 comment added Sonic the Anonymous Hedgehog When are the meta post updates in your list going to occur?
Sep 24, 2020 at 18:33 answer added GSerg timeline score: 9
Sep 24, 2020 at 18:27 answer added user312421 timeline score: 4
Sep 24, 2020 at 16:58 answer added Larnu timeline score: 7
Sep 24, 2020 at 16:19 history edited Ben KellyStaffMod CC BY-SA 4.0
added 58 characters in body
S Sep 22, 2020 at 14:57 history suggested Zachary Craig CC BY-SA 4.0
replace perf with performance
Sep 22, 2020 at 12:48 review Suggested edits
S Sep 22, 2020 at 14:57
Sep 21, 2020 at 18:51 answer added Lionel Rowe timeline score: 10
Sep 21, 2020 at 14:39 answer added Josh Goebel timeline score: 30
Sep 19, 2020 at 13:58 answer added Peter Cordes timeline score: 16
Sep 18, 2020 at 4:04 answer added b3m2a1 timeline score: 18
Sep 17, 2020 at 20:32 comment added Bohemian @Ben just to be clear, any such feature would have to work for all languages. It would be a cross-cutting concern. Is forking highlight.js and using our own version an option?
Sep 17, 2020 at 19:22 comment added Ben Kelly StaffMod @Bohemian No, not that I'm aware of. We could add diff language support somewhere down the line, but that has its own problems when it comes to highlighting
Sep 17, 2020 at 19:21 comment added Ben Kelly StaffMod @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
Sep 17, 2020 at 1:43 comment added Clonkex Don't forget to update this page to mention highlight.js instead of Google Prettify.
Sep 16, 2020 at 20:38 history edited Sonic the Anonymous Hedgehog CC BY-SA 4.0
Add link to Google announcement of discontinuation
Sep 15, 2020 at 21:57 answer added Bohemian timeline score: 6
Sep 15, 2020 at 0:00 comment added Bohemian Does highlight.js support in-code emphasis?
Sep 14, 2020 at 14:19 comment added Ollie @hkotsubo I thought they did that already. It is back to normal now, though...the code-block line-height.
Sep 14, 2020 at 14:12 answer added Arnauld timeline score: 12
Sep 11, 2020 at 8:39 comment added Liam AT LAST typescript support. It's only 7 years old...
Sep 11, 2020 at 6:17 answer added Sonic the Anonymous Hedgehog timeline score: 28
Sep 11, 2020 at 6:03 answer added Sonic the Anonymous Hedgehog timeline score: 8
Sep 10, 2020 at 17:14 comment added Holger Does that imply that we finally get highlighting of a language’s actual keywords, instead of some random words picked up from different languages? That would be great.
Sep 10, 2020 at 15:50 history edited Ben KellyStaffMod CC BY-SA 4.0
added 140 characters in body
Sep 9, 2020 at 23:15 answer added user361230 timeline score: 10
Sep 9, 2020 at 17:54 answer added jtbandes timeline score: 20
Sep 9, 2020 at 13:23 comment added Darragh Enright Cool :) Does this mean lang-elixir will finally get explicit syntax highlighting support?
Sep 9, 2020 at 12:53 comment added hkotsubo Whatever you do, please don't change the line-height for code blocks
Sep 9, 2020 at 9:41 answer added TRiG timeline score: 11
Sep 9, 2020 at 9:40 answer added Olivier Dulac timeline score: 60
Sep 9, 2020 at 6:19 comment added Catija Please, ask your questions as answers, as that gives Ben more room to respond individually!
Sep 9, 2020 at 5:47 comment added Mast Are there regression tests in place that verify the risk of breaking changes being minimal?
Sep 9, 2020 at 5:15 answer added Jerry Coffin timeline score: 118
Sep 9, 2020 at 1:02 comment added Mike 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.
Sep 9, 2020 at 0:07 comment added Cody Gray - on strike 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.
Sep 8, 2020 at 23:03 comment added Sonic the Anonymous Hedgehog @Braiam I thought SO was their core product. Syntax highlighting is a core part of that.
Sep 8, 2020 at 22:41 comment added Braiam @SonictheMaskedWerehog why invest resources into something that isn't the core product?
Sep 8, 2020 at 22:22 comment added Sonic the Anonymous Hedgehog Just a curious question: why continue to use a third-party syntax highlighter, rather than have an internal official syntax highlighter that was maintained by SE employees?
Sep 8, 2020 at 20:25 comment added Ben Kelly StaffMod @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.
Sep 8, 2020 at 20:23 history edited Franck Dernoncourt CC BY-SA 4.0
Added units
Sep 8, 2020 at 20:08 comment added Mark 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.)
Sep 8, 2020 at 19:54 answer added Sonic the Anonymous Hedgehog timeline score: 182
Sep 8, 2020 at 19:29 comment added Ben Kelly StaffMod @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.
Sep 8, 2020 at 19:22 history edited Sonic the Anonymous Hedgehog CC BY-SA 4.0
That post isn't about Prettify itself being out of date. That was just a request to update SE's version of Prettify to a newer version.
Sep 8, 2020 at 19:18 comment added Sonic the Anonymous Hedgehog I hope the syntax highlighting FAQs (both here and on MSO) are part of that list as well.
Sep 8, 2020 at 19:04 comment added Ben Kelly StaffMod @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
Sep 8, 2020 at 18:56 comment added rene I have some updating to do then, for example on this one: What is the default language for the syntax highlighter? ...
Sep 8, 2020 at 18:47 history edited Ben KellyStaffMod CC BY-SA 4.0
added 28 characters in body
Sep 8, 2020 at 18:40 comment added Luuklag Good to see that the Teams devs are also bringing features to the public network!
Sep 8, 2020 at 18:30 history edited Catija
edited tags
Sep 8, 2020 at 18:28 history asked Ben KellyStaffMod CC BY-SA 4.0