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

I can't figure out why this question I have on SO doesn't do syntax highlighting. Usually I don't have to do anything as long as I've got the tag in place (in this case jquery). I've also tried:

<script language=javascript>

<!-- language: lang-js -->

What am I doing wrong?

share|improve this question
Looks like it's highlighting keywords – random Sep 18 '12 at 3:30

1 Answer 1

up vote 4 down vote accepted

Your language comment was being ignored because there wasn't another line between that and the first <script> element you had there, so that entire piece was being removed as bad HTML, and it was interpreting the code as HTML because of the second, opening <script> tag.

Without the language comment, it's interpreted as HTML because it starts with an HTML opening tag. You could just remove the surrounding <script> tags and it should highlight as normal code.

share|improve this answer
Thanks, that was bothering me! – Tom Sep 18 '12 at 3:34

You must log in to answer this question.

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