A note needs to show the literal text flag`name. Wrap it in two backticks on each side so the one in the middle remains visible.

Count the outer and inner backticks

``flag`name``

Two backticks on each side enclose a single literal backtick in the middle.

Illustrated delimiter count. Use a longer outer run than the content uses.

Separate touching runs with a space

If the content starts and ends with backticks, add one space just inside each outer delimiter.

`` `ready` ``

For this code span, CommonMark strips the paired padding spaces. Copy the rendered result to a scratch file and check that it contains the word ready with one backtick on each end.

Spaces separate the outer delimiters from literal backticks around ready.

Illustrated padding case. Copy the rendered text to inspect both ends.

CommonMark’s code span rules