Your fence ate the page

Three symptoms, one cause: the fence isn't doing what you think it's doing.

Fenced beats indented

Only a fence can carry a language name. The four-space indented style gives you monospace text and nothing else.

Nesting is fence length

Backslash escapes don't work inside code blocks. To show three backticks, open the wrapper with four.

A bad language fails quietly

Misspell the identifier and you get no error, just a flat gray block. If your code looks plain, check the spelling first.

Containers change the rules

Inside a list, indent the fence to the item's text. Inside a table, you can't use one at all. Use inline code instead.

Fences aren't portable

Slack drops the highlighting. A plain-text application form drops everything, backticks included. Test the destination.

Get the fences right

Diff blocks, tilde fences, and the indentation each container needs, with examples.

Read the code block guide