mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update MD038/no-space-in-code to allow code spans with only spaces (fixes #1481).
This commit is contained in:
parent
2d2fafc58d
commit
90cf515ff0
7 changed files with 56 additions and 68 deletions
18
doc/md038.md
18
doc/md038.md
|
|
@ -6,8 +6,8 @@ Aliases: `no-space-in-code`
|
|||
|
||||
Fixable: Some violations can be fixed by tooling
|
||||
|
||||
This rule is triggered for code span elements that have spaces adjacent to the
|
||||
backticks:
|
||||
This rule is triggered for code spans that have content with spaces next to the
|
||||
beginning or ending backticks:
|
||||
|
||||
```markdown
|
||||
`some text `
|
||||
|
|
@ -15,14 +15,21 @@ backticks:
|
|||
` some text`
|
||||
```
|
||||
|
||||
To fix this, remove any spaces adjacent to the backticks:
|
||||
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 (in order to allow for code spans that embed backticks):
|
||||
automatically trimmed by the parser (in order to allow for code spans that embed
|
||||
backticks):
|
||||
|
||||
```markdown
|
||||
`` `backticks` ``
|
||||
|
|
@ -36,5 +43,4 @@ span markers from an embedded backtick (though the space is not trimmed):
|
|||
```
|
||||
|
||||
Rationale: Violations of this rule are usually unintentional and may lead to
|
||||
improperly-rendered content. If spaces beside backticks are intentional, this
|
||||
rule can be disabled for that line or file.
|
||||
improperly-rendered content.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue