Inline formatting are only valid if open keyword is followed by non-whitespace and closing preceded by non-whitespace.
This makes it impossible to have whitespace at start or end of verbatim formatting.
However, whitespace at start and end would be hard to read anyways.
A better alternativ is to use certain Unicode symbols to explicitly show that a whitespace is required here.
Some good symbols are mentioned in this stackexchange post.
In short:
- For keyboard-space
- Good font coverage: U+2423 Open Box "␣"
- Looks better: U+23B5 Bottom Square Bracket "⎵"
- For spaces between words
- Good font coverage: U+00B7 Middle dot "·"
- Looks better: U+2E31 Word Separator Middle Dot "⸱"
This should be documented in the verbatim formatting section.