fixup! Allow trailing spaces in code blocks

This commit is contained in:
Wouter Admiraal 2019-05-28 08:38:56 +02:00
parent 2e391a5ca1
commit 2722940f3c
3 changed files with 4 additions and 5 deletions

View file

@ -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) {

View file

@ -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}

View file

@ -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}