Ocassionaly there are questions posted under the tag on StackOverflow without a corresponding tag.

Please update the tag to use JavaScript code formatting by default.

Also, should I edit those to add anyway?


It's probably a good suggestion to add JavaScript syntax highlighting to the tag, since in the absence of other more popular tags, any code in the question is most likely JavaScript.

Until that's done however, it's not necessary to add the tag to every question which contains JavaScript. For example, if I wanted to ask a question about different versions of jQuery, the only tag that's absolutely necessary is . I would only add the tag if I wanted to get more attention from the largest possible audience; the question is not actually about JavaScript.

When it's warranted, yes please add the , but otherwise, I would recommend using syntax highlighting language hints instead. For example:

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


<!-- language-all: lang-js --> 
  • I use the hints often, but they only apply to the block of code immediately following. So when there are multiple blocks, it gets pretty annoying. Also, the edit history then looks like I changed the whole section. And it doesn't do anything for inline code. – Matt Johnson-Pint Jul 9 '13 at 22:54
  • I wish there was a way to select or vote for code format of a tag on the tag's info page (like synonyms), rather than having to discuss each one separately. – Matt Johnson-Pint Jul 9 '13 at 22:55
  • @MattJohnson you can apply one hint for all code in the question using <!-- language-all: lang-js --> at the top of the question. – p.s.w.g Jul 9 '13 at 22:56
  • Ahh, thanks! I knew about language, but not language-all. Does it work for inline code also? – Matt Johnson-Pint Jul 9 '13 at 22:56
  • @MattJohnson To my knowledge, inline code blocks never have syntax highlighting. – p.s.w.g Jul 9 '13 at 22:57
  • I double checked, and you're right! I guess I need to go see an eye doctor. ;-) – Matt Johnson-Pint Jul 9 '13 at 22:59

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