For some days I have been noticing that on Stack Overflow the Markdown content is rendered as black text only.
And this is how I actually see this page:
For some days I have been noticing that on Stack Overflow the Markdown content is rendered as black text only.
And this is how I actually see this page:
It works as designed.
I've hand-picked lang-php
in your two example posts and syntax highlighting came to life. Both posts only had the laravel-7 tag
The laravel-7 tag doesn't have a syntax highlighter configured. That leads to no attempt to do any syntax highlighting
The laravel tag does have the lang-php
highlighter selected. On posts with that tag the highlighter does attempt to bring some color to PHP.
Ask a mod to set the syntax highlighter to lang-php on laravel-7 to prevent future confusion.
Note that laravel-4 has lang-default
as highlighter and laravel-5 and laravel-6 have no highlighter set either. Maybe that is on purpose. Before choosing the correct highlighter maybe consult in the PHP or Laravel chatroom first or open a feature/support request here on Meta to reach consensus.
The default for how Stack Exchange leverages Highlight.js is so utterly useless that by no means it should be the default. If no highlighter is selected, lang-none is intended. If you want the auto-detect of highlight.js to screw up due to it not having a suitable grammar (SE limits heavily what is avaialable) then ask for lang-default on your favorite tag. If there is a sane by Stack Exchange supported language highlighter in its highlight.js package, have a mod add that language hint to the tag.
Please support:
StackExchange.using("highlightjs", function () { $("pre").each(function () { this.classList.add('s-code-block'); StackExchange.highlightjs.instance.highlightBlock(this); }); });
on this page and it gets properly auto-detected as PHP.
Feb 7, 2021 at 18:48
lang-php
. If there's a general desire to have them be lang-default
, they can all be changed to that, but my impression is that having them all consistent is desirable. Another reasonable possibility is to have the larvel-[4567] tags all set to lang-default
. How SE has the new highlighter set up is...frustrating.
lang-default
. I have no idea whether that actually matches reality, however.
default
, but auto-detection is not great when we don't actually have a grammar for the language in question. We have no "Larvel" grammar... so perhaps it picks HTML, perhaps it picks PHP, perhaps it picks something else... Setting the larvel
tag language to php
is probably a reasonable thing to do for now.
Feb 15, 2021 at 2:32
lang-none
default
(example). If no tags on the question have a "Code Language", no highlighting will occur automatically.