mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
fixup! Allow trailing spaces in code blocks
This commit is contained in:
parent
2e391a5ca1
commit
2722940f3c
3 changed files with 4 additions and 5 deletions
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
|
||||
inFencedCode += onFence;
|
||||
const lineNumber = lineIndex + 1;
|
||||
if ((!inCode || inFencedCode !== 0) && trailingSpaceRe.test(line) &&
|
||||
if ((!inCode || inFencedCode) && trailingSpaceRe.test(line) &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
const actual = line.length - line.trimRight().length;
|
||||
if (expected !== actual) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ This is a code block that won't trigger.
|
|||
```text
|
||||
This is code
|
||||
|
||||
with an empty line.
|
||||
with a line with trailing spaces. {MD009:14}
|
||||
```
|
||||
|
||||
But we'll do another:
|
||||
|
|
@ -21,4 +21,3 @@ But we'll do another:
|
|||
will.
|
||||
|
||||
Final text is here
|
||||
{MD009:14}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
This line has a single trailing space {MD009}
|
||||
This line has two trailing spaces and should be allowed
|
||||
This line has three trailing spaces {MD009}
|
||||
|
||||
{MD009:4}
|
||||
This line has four trailing spaces {MD009}
|
||||
|
||||
{MD009:5}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue