2025-02-07 20:03:30 -08:00
|
|
|
This rule is triggered for code spans containing content with unnecessary space
|
|
|
|
next to the beginning or ending backticks:
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
`some text `
|
|
|
|
|
|
|
|
` some text`
|
2025-02-07 20:03:30 -08:00
|
|
|
|
|
|
|
` some text `
|
2022-10-29 23:21:45 -07:00
|
|
|
```
|
|
|
|
|
2025-02-07 20:03:30 -08:00
|
|
|
To fix this, remove the extra space characters from the beginning and ending:
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
`some text`
|
|
|
|
```
|
|
|
|
|
2025-02-07 20:03:30 -08:00
|
|
|
Note: A single leading *and* trailing space is allowed by the specification and
|
|
|
|
trimmed by the parser to support code spans that begin or end with a backtick:
|
2025-02-02 21:36:35 -08:00
|
|
|
|
|
|
|
```markdown
|
2025-02-07 20:03:30 -08:00
|
|
|
`` `backticks` ``
|
|
|
|
|
|
|
|
`` backtick` ``
|
2025-02-02 21:36:35 -08:00
|
|
|
```
|
|
|
|
|
2025-02-07 20:03:30 -08:00
|
|
|
Note: When single-space padding is present in the input, it will be preserved
|
|
|
|
(even if unnecessary):
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
```markdown
|
2025-02-07 20:03:30 -08:00
|
|
|
` code `
|
2022-10-29 23:21:45 -07:00
|
|
|
```
|
|
|
|
|
2025-02-07 20:03:30 -08:00
|
|
|
Note: Code spans containing only spaces are allowed by the specification and are
|
|
|
|
also preserved:
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
```markdown
|
2025-02-07 20:03:30 -08:00
|
|
|
` `
|
|
|
|
|
|
|
|
` `
|
2022-10-29 23:21:45 -07:00
|
|
|
```
|
|
|
|
|
2025-02-07 20:03:30 -08:00
|
|
|
Rationale: Violations of this rule are usually unintentional and can lead to
|
2025-02-02 21:36:35 -08:00
|
|
|
improperly-rendered content.
|