I thought that the code formatter was supposed to default the language formatting if one of the tags matches a language. But I've found that in questions tagged I still need to write <!-- language: lang-bash --> to get answers to format properly. An example is:

Copy multiple files from one directory to another from Linux shell

If we don't add the language comment, the /* in the pathnames is formatted as a comment, even though this isn't bash commenting syntax.

Hmm - the drop down for associating a language with a tag says lang-bsh (note the missing "a"). Could this be the cause of the problem? –  ChrisF Jun 13 at 15:13
Looks like someone bashed the "a" out of the option. –  gunr2171 Jun 14 at 22:43
@ChrisF According to the JS file, all of the following keywords work to get Bash highlighting: ["bash","bsh","csh","sh"] –  animuson Jun 16 at 17:19

1 Answer 1

up vote 3 down vote accepted

I've located the problem here. It's because the question has two tags which both have different syntax highlighting enabled. In these cases, the system reverts everything to default and lets the highlighter infer which language should be used.

Even though both of these identifiers go to the same Bash syntax highlighting, because they are keywords to the same thing (synonyms), the system which detects and determines which syntax highlighting to use doesn't realize that and just assumes they are different.

I've changed the tag to use lang-sh so that both tags and being on one question won't cause the highlighter to just ignore them. Let us know if you run across any other bash-related tags that aren't highlighting correctly and we'll look into them to make sure it's not the same issue.

I edited my answer in the linked question to remove the language comment, and the highlighting is correct. Thanks. –  Barmar Jun 16 at 17:30

You must log in to answer this question.

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