Question: On the main site, this

```
<!-- language: lang-shell -->

    # do these steps on each distro
    mv Documents Documents.old
    ln -s /shared/your-user/Documents Documents
    mv -i Documents.old/* Documents/
    rmdir Documents.old

```

produced rather silly syntax highlighting (screenshot, since I can't get *any* syntax highlighting to happen on meta):

[![Above example, screenshot from the preview](https://i.stack.imgur.com/Bg5U0.png)](https://i.stack.imgur.com/Bg5U0.png)

It seems to think `Documents` means something to shell. And possibly that `rmdir` introduces a comment (or at least it uses the same color as the comment up top). I tried `lang-sh` and `lang-bash` as well, both do the same.

The documentation says shell should be supported: [What is syntax highlighting and how does it work?](https://meta.stackexchange.com/questions/184108/what-is-syntax-highlighting-and-how-does-it-work)

Answer: 
You either need to specify a tag name, or a language prefixed with `lang-`. There is no registered language named `shell`, so `lang-shell` kicks it into a default mode the same as if you'd done `lang-foobarbaz`, and apparently in that mode it looks for C-style comments.

If you do `<!-- language: lang-sh -->`, or `<!-- language: shell -->` (which tells it to use the language associated with the [shell](https://unix.stackexchange.com/questions/tagged/shell "show questions tagged 'shell'") tag, which is `lang-sh`), it should work, and the last section doesn't get highlighted as a comment. `Documents` is still wrong though, it gets colored as a typename, which seems to be happening because it's capitalized. I tried to look into [code-prettify](https://github.com/google/code-prettify) to see why they do that, but I don't even see support for `lang-sh`, so it's not clear to me how this all fits together. But whatever the problem is, it's probably in code-prettify, not anything in Stack Exchange.
You didn't notice (or at least didn't mention)
that the last word of the fourth line, and the entire fifth line,
are colored gray as comments. 
That is almost surely because, right in the middle of the fourth line,
you have `/*`, so everything up through a matching `*/` is a comment.

I find `lang-sh` formatting to be annoying and distracting,
so I often suppress it with `lang-none`. 
You can also get a code block
displayed in the fixed-width font that we're accustomed to, but no silly colors,
by putting it in a `<pre>`...`</pre>` block. 
(Of course then you must use `&lt;` instead of `<`,
and maybe also `&gt;` in place of `>`.)

This is documented somewhere, but I don't know how well known it is,
so I'll repeat it here.
```
<!-- language: lang-*xxx* -->
```

sets the pretty-printing language for the immediately following code block.

```
<!-- language**-all**: lang-*xxx* -->
```

sets it for all remaining code blocks in the post
(or until it is overridden by another

```
<!-- language: lang-*xxx* -->
```
).