Hi,
awk code like the following is only readable in the dark schemes.
In the light schemes (like Minima or Graceful) it becomes dark grey on black background, and is hardly readable.
I tested with Safari and Chrome on IOS and Android.
I've noticed the same, yes. It used to be fine on the Light theme (which is what I use as well), with colours and syntax highlighting and whatnot. But a little while ago it changed to very-dark-gray on a nearly-black-background, and became unreadable as a result. That's why I've gone back to putting everything in "[CODE]" tags again, since it's the only way I can actually read anything.
So, it seems the issue is with the either the syntax highlighter and / or the light themes for the "awk" syntax, so please do not use this as it has been disabled (above)
```awk
```
You can use the above, but it will have no effect since it is disabled (removed from the list) in the settings.
My best guess without digging into the code is that the awk syntax highlighting used by Discourse has a problem, because when I disable it the problem goes away.
I have no plans to spend any additional time debugging this particular syntax highlighter issue.
Hope this helps.
FWIW, I use this for most unix-like command-line code:
```bash
```
or
```shell
```
... but you can eithe rshell or bash (or another syntax tag) and see if these syntax highlighters works for you.
If you wish to dig further, please check out this documentation:
Syntax highlighting is performed by highlight.js which is a part of the core Discourse code base.
Cheers.
See Also:
As this code is open source, anyone can suggest changes to the code and contribute to development.
My "best guess" is that few people use awk syntax highlighting, so it's not well developed. Anyone who loves awk is of course free to improve it's syntax highlighting.
It would be best if you could use the developer console in your favorite browser and identify the exact CSS and id/class of the HTML element.
Normally developers need the HTML element (class or id) in the DOM to troubleshoot.
This info can be easily ascertained in the browser development console by highlighting the element, right click, and then Inspect option.
This will bring up the browser console and the elements tab and the info is there (plus you can test and double check by changing the attributes of the element in the console).
On the other hand, OTTOMH, when I did a quick look earlier this AM, it seemed to me that the awk syntax highlighter is very primitive and not really something "so great" as to take any action but to disable it,
From a quick review, the awk syntax highlighter seemed "not well developed" so my thought was to just disable it on our site; however, if folks think that it really has added value (the awk syntax highlights), then let's definitely look into getting it fixed.
When you have the exact HTML element, you can search the source code repos(s) to find an exact match, which will help the trip down the rabbit hole on this small issue.
Do you want me to reenable the awk syntax hi-lighting for now or leave it (off) as-is?
I'm totally neutral on this, tbh, since I only use dark themes these days and do not use the awk syntax highlighter feature in Markdown ( typically I highlight in shell or bash for this type of code) or (of course) ruby for Ruby code, etc. etc.
If you see any more of this same issue with certain highlighters and the light themes, please post back here and we can disable them for now and keep track of them, as so far we have disabled (removed) only the following from syntax highlighting support: