mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Allow trailing spaces in indented code blocks (#191)
This commit is contained in:
parent
2f1c2c5312
commit
779a55a662
4 changed files with 17 additions and 3 deletions
|
|
@ -30,9 +30,11 @@ module.exports = {
|
|||
listItemLineNumbers.sort((a, b) => a - b);
|
||||
}
|
||||
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
||||
forEachLine(lineMetadata(), (line, lineIndex) => {
|
||||
let inFencedCode = 0;
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
|
||||
inFencedCode += onFence;
|
||||
const lineNumber = lineIndex + 1;
|
||||
if (trailingSpaceRe.test(line) &&
|
||||
if ((!inCode || inFencedCode) && trailingSpaceRe.test(line) &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
const actual = line.length - line.trimRight().length;
|
||||
if (expected !== actual) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue