mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD009/no-trailing-spaces with code_blocks parameter to allow reporting/fixing trailing spaces in indented/fenced code blocks (fixes #1181).
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
This commit is contained in:
parent
7beb9fc9d0
commit
a55d5499e2
16 changed files with 590 additions and 34 deletions
17
doc/Rules.md
17
doc/Rules.md
|
|
@ -295,6 +295,7 @@ Aliases: `no-trailing-spaces`
|
|||
Parameters:
|
||||
|
||||
- `br_spaces`: Spaces for line break (`integer`, default `2`)
|
||||
- `code_blocks`: Include code blocks (`boolean`, default `false`)
|
||||
- `list_item_empty_lines`: Allow spaces for empty lines in list items
|
||||
(`boolean`, default `false`)
|
||||
- `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
||||
|
|
@ -304,21 +305,19 @@ Fixable: Some violations can be fixed by tooling
|
|||
This rule is triggered on any lines that end with unexpected whitespace. To fix
|
||||
this, remove the trailing space from the end of the line.
|
||||
|
||||
Note: Trailing space is allowed in indented and fenced code blocks because some
|
||||
languages require it.
|
||||
|
||||
The `br_spaces` parameter allows an exception to this rule for a specific number
|
||||
of trailing spaces, typically used to insert an explicit line break. The default
|
||||
value allows 2 spaces to indicate a hard break (\<br> element).
|
||||
value allows 2 spaces to indicate a hard break (\<br> element). (You must set
|
||||
`br_spaces` to a value >= 2 for this parameter to take effect. Setting
|
||||
`br_spaces` to 1 behaves the same as 0, disallowing any trailing spaces.)
|
||||
|
||||
Note: You must set `br_spaces` to a value >= 2 for this parameter to take
|
||||
effect. Setting `br_spaces` to 1 behaves the same as 0, disallowing any trailing
|
||||
spaces.
|
||||
By default, trailing space is allowed in indented and fenced code blocks because
|
||||
some programming languages require that. To report such instances, set the
|
||||
`code_blocks` parameter to `true`.
|
||||
|
||||
By default, this rule will not trigger when the allowed number of spaces is
|
||||
used, even when it doesn't create a hard break (for example, at the end of a
|
||||
paragraph). To report such instances as well, set the `strict` parameter to
|
||||
`true`.
|
||||
paragraph). To report such instances, set the `strict` parameter to `true`.
|
||||
|
||||
```markdown
|
||||
Text text text
|
||||
|
|
|
|||
17
doc/md009.md
17
doc/md009.md
|
|
@ -7,6 +7,7 @@ Aliases: `no-trailing-spaces`
|
|||
Parameters:
|
||||
|
||||
- `br_spaces`: Spaces for line break (`integer`, default `2`)
|
||||
- `code_blocks`: Include code blocks (`boolean`, default `false`)
|
||||
- `list_item_empty_lines`: Allow spaces for empty lines in list items
|
||||
(`boolean`, default `false`)
|
||||
- `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
||||
|
|
@ -16,21 +17,19 @@ Fixable: Some violations can be fixed by tooling
|
|||
This rule is triggered on any lines that end with unexpected whitespace. To fix
|
||||
this, remove the trailing space from the end of the line.
|
||||
|
||||
Note: Trailing space is allowed in indented and fenced code blocks because some
|
||||
languages require it.
|
||||
|
||||
The `br_spaces` parameter allows an exception to this rule for a specific number
|
||||
of trailing spaces, typically used to insert an explicit line break. The default
|
||||
value allows 2 spaces to indicate a hard break (\<br> element).
|
||||
value allows 2 spaces to indicate a hard break (\<br> element). (You must set
|
||||
`br_spaces` to a value >= 2 for this parameter to take effect. Setting
|
||||
`br_spaces` to 1 behaves the same as 0, disallowing any trailing spaces.)
|
||||
|
||||
Note: You must set `br_spaces` to a value >= 2 for this parameter to take
|
||||
effect. Setting `br_spaces` to 1 behaves the same as 0, disallowing any trailing
|
||||
spaces.
|
||||
By default, trailing space is allowed in indented and fenced code blocks because
|
||||
some programming languages require that. To report such instances, set the
|
||||
`code_blocks` parameter to `true`.
|
||||
|
||||
By default, this rule will not trigger when the allowed number of spaces is
|
||||
used, even when it doesn't create a hard break (for example, at the end of a
|
||||
paragraph). To report such instances as well, set the `strict` parameter to
|
||||
`true`.
|
||||
paragraph). To report such instances, set the `strict` parameter to `true`.
|
||||
|
||||
```markdown
|
||||
Text text text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue