Please add a "prettyprint" CSS class when explicitly defining class with
<!-- language: something -->
regardless of there being no valid language tag.
It is inspired by question Syntax highlighting not working.
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityPlease add a "prettyprint" CSS class when explicitly defining class with
<!-- language: something -->
regardless of there being no valid language tag.
It is inspired by question Syntax highlighting not working.
Code with no matching tags for language will now be prettified if they have an override after the next deploy.
class
is added to the HTML upon saving, so the few existing cases (if any) where it's lacking need a dummy edit.
To enhance on this a bit: without any language tags in the question, the following should work too. After the first deployment it did output <pre class="lang-html"><code> ... </code></pre>
but without the additional class="prettyprint"
the syntax highlighting was not triggered.
<!-- language: html -->
While not hinted otherwise: <html> source <b>goes</b> "here".
<!-- language: javascript -->
var a = 3;
while(not (a > 0)){
alert("JavaScript code <b>goes</b> here.");
}
This rendered without highlighting, but meanwhile things have been fixed. A new (dummy) save of the post gets one the expected highlighting:
While not hinted otherwise: <html> source <b>goes</b> "here".
var a = 3;
while(not (a > 0)){
alert("JavaScript code <b>goes</b> here.");
}
The preview uses the default Prettify, which is fine to me.