diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 1673603c..2110ac35 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -2672,7 +2672,6 @@ module.exports = { paragraphLineNumbers.push(i + 1); } }); - paragraphLineNumbers.sort(numericSortAscending); filterTokens(params, "inline", (token) => { if (token.children.some((child) => child.type === "code_inline")) { const tokenLines = params.lines.slice(token.map[0], token.map[1]); @@ -2684,7 +2683,6 @@ module.exports = { }); } }); - codeInlineLineNumbers.sort(numericSortAscending); } const expected = (brSpaces < 2) ? 0 : brSpaces; forEachLine(lineMetadata(), (line, lineIndex, inCode) => { diff --git a/lib/md009.js b/lib/md009.js index 8efff15b..7436ada0 100644 --- a/lib/md009.js +++ b/lib/md009.js @@ -32,7 +32,6 @@ module.exports = { paragraphLineNumbers.push(i + 1); } }); - paragraphLineNumbers.sort(numericSortAscending); filterTokens(params, "inline", (token) => { if (token.children.some((child) => child.type === "code_inline")) { const tokenLines = params.lines.slice(token.map[0], token.map[1]); @@ -44,7 +43,6 @@ module.exports = { }); } }); - codeInlineLineNumbers.sort(numericSortAscending); } const expected = (brSpaces < 2) ? 0 : brSpaces; forEachLine(lineMetadata(), (line, lineIndex, inCode) => { diff --git a/test/hard-line-breaks.md b/test/hard-line-breaks.md index ee0b9692..3541c216 100644 --- a/test/hard-line-breaks.md +++ b/test/hard-line-breaks.md @@ -62,6 +62,14 @@ text `code span code span` text +Text text + +Text `code span` text + +Text text +`code span` +text text + {MD009:9} {MD009:24} {MD009:32} @@ -75,3 +83,6 @@ span` text {MD009:61} {MD009:62} {MD009:63} +{MD009:65} +{MD009:67} +{MD009:71} diff --git a/test/snapshots/markdownlint-test-scenarios.js.md b/test/snapshots/markdownlint-test-scenarios.js.md index 6458576e..76a35b5d 100644 --- a/test/snapshots/markdownlint-test-scenarios.js.md +++ b/test/snapshots/markdownlint-test-scenarios.js.md @@ -12167,6 +12167,63 @@ Generated by [AVA](https://avajs.dev). 'no-trailing-spaces', ], }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 65, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md009', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 22, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 22, + }, + lineNumber: 67, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md009', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + }, + { + errorContext: null, + errorDetail: 'Expected: 0 or 2; Actual: 2', + errorRange: [ + 10, + 2, + ], + fixInfo: { + deleteCount: 2, + editColumn: 10, + }, + lineNumber: 71, + ruleDescription: 'Trailing spaces', + ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md009', + ruleNames: [ + 'MD009', + 'no-trailing-spaces', + ], + }, ], fixed: `# Hard Line Breaks␊ ␊ @@ -12232,6 +12289,14 @@ Generated by [AVA](https://avajs.dev). span code␊ span\` text␊ ␊ + Text text␊ + ␊ + Text \`code span\` text␊ + ␊ + Text text ␊ + \`code span\` ␊ + text text␊ + ␊ {MD009:9}␊ {MD009:24}␊ {MD009:32}␊ @@ -12245,6 +12310,9 @@ Generated by [AVA](https://avajs.dev). {MD009:61}␊ {MD009:62}␊ {MD009:63}␊ + {MD009:65}␊ + {MD009:67}␊ + {MD009:71}␊ `, } diff --git a/test/snapshots/markdownlint-test-scenarios.js.snap b/test/snapshots/markdownlint-test-scenarios.js.snap index ab4979f2..007fe733 100644 Binary files a/test/snapshots/markdownlint-test-scenarios.js.snap and b/test/snapshots/markdownlint-test-scenarios.js.snap differ