name: adjacent-code-no-space default: true advisory: false fix: false since: 0.1.0

adjacent-code-no-space

Inline code span adjacent to a letter without whitespace.

What it does

Flags inline code spans whose backticks touch an adjacent alphanumeric or backtick character without an intervening space, e.g. `foo`bar or `foobar` ``.

Why

CommonMark renders `foo`bar as <code>foo</code>bar; the visual result runs the code into the prose with no visual break, which is almost always a typo for `foo` bar or `foobar`. Two consecutive code spans with no space between them ( `foobar` ``) is even more ambiguous: it depends on backtick counting and renders inconsistently across implementations.

Example (bad)

Call `vec.push(x)`afterwards.

Example (good)

Call `vec.push(x)` afterwards.

Configuration

  • Disable inline: <!-- mdwright: allow adjacent-code-no-space -->.
  • Disable in config: [lint] ignore = ["adjacent-code-no-space"].
  • Severity: non-advisory.

References