What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I just noticed that the prettify language hint for questions tagged has been changed to lang-default; it was lang-css before. While this allows HTML code blocks to be highlighted as HTML, unfortunately it prevents CSS code blocks from being highlighted as CSS. So now instead of adding the lang-html hint to HTML code blocks, I now have to add lang-css to CSS code blocks!

What's the reason for this change? (Note, only developers and moderators have the ability to change the prettify language for a given tag.)

Also, if I try to change it back to lang-css, I get this prompt:

Setting a language to a value other than default should ONLY be done if the odds of a XML, Javascript, or HTML code block in the same post is very low,are you sure you wish to make this change?

And then I'm reminded of that question I asked not too long ago, linked above, regarding highlighting HTML code blocks in questions with lang-css, and then I cancel and step back on making the change.

Is there something else going on with prettify and HTML/CSS code blocks behind the scenes that I'm not aware of? It'd be great if a developer working on integrating prettify with the site could help me understand this.

share|improve this question
2  
Oh and there's a space missing between "low," and "are" in the prompt. –  BoltClock's a Unicorn Feb 9 '12 at 16:50
3  
That comma should be a semicolon anyway... –  mmyers Feb 9 '12 at 16:52
    
@mmyers: Indeed. –  BoltClock's a Unicorn Feb 9 '12 at 16:52
    
Also, "an XML", not "a XML". –  BoltClock's a Unicorn Feb 9 '12 at 17:27
    
Also, "JavaScript", not "Javascript". –  BoltClock's a Unicorn Feb 9 '12 at 17:27
1  
CSS syntax highlighting appears to be broken right now. I had to add <!-- language: lang-css --> to make the CSS highlighting for this work. –  thirtydot Feb 13 '12 at 15:07
    
@thirtydot: Yes, that's why I brought this up. I should have mentioned it in this question, so I've edited it now. –  BoltClock's a Unicorn Feb 13 '12 at 15:18
    
I think you should change it back to lang-css for the time being. Broken HTML is better than broken CSS. At least, I was used to the broken HTML highlighting.. Although, that might make this bug report more difficult to understand. –  thirtydot Feb 13 '12 at 15:22

1 Answer 1

up vote 3 down vote accepted
+200

I changed it in anger that both html and javascript in questions were not being properly styled, while css (which I loathe :) was.

I was unaware of the previous meta discussion - we can change it back if the community wants.

share|improve this answer
2  
Ha, I knew it! Well, I think it's better to change it back as we (well, I) have added lang-html hints to a number of posts, as well as what thirtydot said. Is there anything else that can be done about the three languages not playing together with prettify though? :/ –  BoltClock's a Unicorn Feb 17 '12 at 19:53
    
I changed it back, but now should we go through and add html hints to every other answer on the question thirtydot linked? I personally don't feel css is more important than javascript and html coloring (insert adage about opinions and a-holes :) –  Jarrod Dixon Feb 17 '12 at 20:46
    
OK, clearly I didn't think that through... from the looks of it, right now deciding on a workaround is between adding hints for HTML and JS, and adding hints for CSS... this was actually why I was hesitant on changing it back myself when I saw the prompt. But I digress — my main gripe here is that the three languages can't highlight correctly together without explicit hints on at least one of them, and I'm hoping that can be addressed somehow. If it can't, though, then I'd rather not upset you ;) –  BoltClock's a Unicorn Feb 17 '12 at 21:15
    
I don't know how to fix this, other than submitting patches for prettify. Making the internet a better place, man! Get to it! –  Jarrod Dixon Feb 18 '12 at 3:08
    
@bolt Jarrod is right about this. No way in hell CSS is more important than JavaScript, much less HTML. –  Jeff Atwood Feb 21 '12 at 9:02
    
@Jeff, Jarrod: I think I finally get what you mean by "more important". I concede, and have changed it back to lang-default. (The rest of the community apart from thirtydot and myself don't seem to care.) Sorry for the trouble. –  BoltClock's a Unicorn Feb 21 '12 at 12:12
    
@Bolt no trouble; it highlights that prettify, while usually awesome, has a wee bit of (understandable) trouble with multiple language detection. –  Jarrod Dixon Feb 21 '12 at 18:26
1  
I submitted an issue about this. The author of Prettify is on Stack Overflow. –  thirtydot Feb 24 '12 at 0:41
    
@thirtydot: Well, it looks more complicated than we thought. Check out his last reply to the issue. –  BoltClock's a Unicorn Apr 3 '12 at 5:37
    
Has this happened again? This question isn't getting the syntax highlighting it deserves. –  U2744 SNOWFLAKE Jul 30 '12 at 1:34
    
@minitech it looks correct to me. If you want css to be highlighted specifically, the language hint needs to be applied to the code block. –  Jarrod Dixon Aug 2 '12 at 20:55
1  
@JarrodDixon: Well, the question's only language tag is CSS, so shouldn't it be highlighted as CSS by default? –  U2744 SNOWFLAKE Aug 3 '12 at 16:06
3  
Isn't this part of a much larger issue then? Surely if multiple tags are provided then lang-default should be enforced, or the first tag specified should enforce the language. I don't see why a question tagged with only CSS shouldn't have lang-css applied by default, and equally I don't see why a question more heavily weighed towards CSS should use something else as the default. I prefer HTML and JavaScript over CSS so I removed it is a really lazy answer. –  James Donnelly May 30 '13 at 22:05
    
@James Donnelly: It is, but unfortunately that "much larger issue" is something that isn't exactly within our control. See the link in thirtydot's comment. –  BoltClock's a Unicorn Jun 17 '13 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .