A practical mental model
  1. 01Inspect the source
  2. 02Check the renderer
  3. 03Verify the destination

Each step answers a different question. Verify the final document in its actual destination.

Find the smallest failing example

Use matching opening and closing fences. Put a language identifier directly after the opening fence. Fences may use backticks or tildes; the closing fence must match the character and be long enough. To show a fenced example inside another code block, use a longer outer fence.

~~~javascript
const message = "A reproducible example";
console.log(message);
~~~

Check the destination behavior

A language identifier requests highlighting, but the destination must include that language grammar. Uncolored code can still be a correctly parsed block. Compare identifiers with the destination documentation and preserve indentation required by the programming language.

A repeatable debugging sequence

  1. Save the failing source before editing it.
  2. Remove surrounding content until a few lines reproduce the symptom.
  3. Compare that sample with the destination documentation.
  4. Change one thing at a time and check both source and output.
  5. Restore the surrounding document and inspect the delivered version.

This separates syntax errors from missing renderer features and inaccessible files. An example that works in one preview can still fail in the final publishing workflow.

Keep the repair portable

Record any required renderer extensions beside the example. Keep essential meaning in ordinary paragraphs and retain the editable original. Check links, assets and formatting after moving the file. Previewing locally helps diagnose the source; the final check belongs where people will actually read it.

When a preview tool helps

A side-by-side preview makes small source changes easier to inspect. Markups is one option for trying the example, but its renderer settings can differ from the publishing destination. Compare the destination output before considering the problem solved.

Sources and related reading

Primary syntax documentation and the CommonMark and GFM compatibility guide.