mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 15:00: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) => {
|
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
|
||||||
inFencedCode += onFence;
|
inFencedCode += onFence;
|
||||||
const lineNumber = lineIndex + 1;
|
const lineNumber = lineIndex + 1;
|
||||||
if ((!inCode || inFencedCode !== 0) && trailingSpaceRe.test(line) &&
|
if ((!inCode || inFencedCode) && trailingSpaceRe.test(line) &&
|
||||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||||
const actual = line.length - line.trimRight().length;
|
const actual = line.length - line.trimRight().length;
|
||||||
if (expected !== actual) {
|
if (expected !== actual) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ This is a code block that won't trigger.
|
||||||
```text
|
```text
|
||||||
This is code
|
This is code
|
||||||
|
|
||||||
with an empty line.
|
with a line with trailing spaces. {MD009:14}
|
||||||
```
|
```
|
||||||
|
|
||||||
But we'll do another:
|
But we'll do another:
|
||||||
|
|
@ -21,4 +21,3 @@ But we'll do another:
|
||||||
will.
|
will.
|
||||||
|
|
||||||
Final text is here
|
Final text is here
|
||||||
{MD009:14}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
This line has a single trailing space {MD009}
|
This line has a single trailing space {MD009}
|
||||||
This line has two trailing spaces and should be allowed
|
This line has two trailing spaces and should be allowed
|
||||||
This line has three trailing spaces {MD009}
|
This line has three trailing spaces {MD009}
|
||||||
|
|
||||||
{MD009:4}
|
|
||||||
This line has four trailing spaces {MD009}
|
This line has four trailing spaces {MD009}
|
||||||
|
|
||||||
|
{MD009:5}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue