markdownlint/doc/md038.md

47 lines
1,010 B
Markdown
Raw Normal View History

# `MD038` - Spaces inside code span elements
Tags: `code`, `whitespace`
Aliases: `no-space-in-code`
Fixable: Some violations can be fixed by tooling
This rule is triggered for code spans that have content with spaces next to the
beginning or ending backticks:
```markdown
`some text `
` some text`
```
To fix this, remove any spaces at the beginning or ending:
```markdown
`some text`
```
Note: Code spans containing only spaces are allowed by the specification:
```markdown
` ` or ` `
```
Note: A single leading and trailing space is allowed by the specification and
automatically trimmed by the parser (in order to allow for code spans that embed
backticks):
```markdown
`` `backticks` ``
```
Note: A single leading or trailing space is allowed if used to separate code
span markers from an embedded backtick (though the space is not trimmed):
```markdown
`` ` embedded backtick``
```
Rationale: Violations of this rule are usually unintentional and may lead to
improperly-rendered content.