Update MD038/no-space-in-code to allow the "single leading and trailing space" scenario (fixes #271).

This commit is contained in:
David Anson 2020-04-06 20:43:38 -07:00
parent 6ce426cf88
commit 65b19b703b
8 changed files with 102 additions and 79 deletions

View file

@ -1401,23 +1401,28 @@ Tags: whitespace, code
Aliases: no-space-in-code
This rule is triggered on code span elements that have spaces right inside the
This rule is triggered for code span elements that have spaces adjacent to the
backticks:
```markdown
` some text `
`some text `
` some text`
```
To fix this, remove the spaces inside the codespan markers:
To fix this, remove any spaces adjacent to the backticks:
```markdown
`some text`
```
Note: A single leading and trailing space is allowed by the specification and
automatically trimmed (to allow for embedded backticks):
```markdown
`` `backticks` ``
```
Note: A single leading or trailing space is allowed if used to separate codespan
markers from an embedded backtick: