mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD027/no-multiple-space-blockquote to handle multiple lines of indented code inside a blockquote (fixes #1393).
This commit is contained in:
parent
368cb1be5f
commit
0eedda0a6c
5 changed files with 44 additions and 4 deletions
|
@ -4680,9 +4680,15 @@ module.exports = {
|
|||
"tags": [ "blockquote", "whitespace", "indentation" ],
|
||||
"parser": "micromark",
|
||||
"function": function MD027(params, onError) {
|
||||
const { tokens } = params.parsers.micromark;
|
||||
for (const token of filterByTypesCached([ "linePrefix" ])) {
|
||||
const siblings = token.parent?.children || params.parsers.micromark.tokens;
|
||||
if (siblings[siblings.indexOf(token) - 1]?.type === "blockQuotePrefix") {
|
||||
const parent = token.parent;
|
||||
const codeIndented = parent?.type === "codeIndented";
|
||||
const siblings = parent?.children || tokens;
|
||||
if (
|
||||
!codeIndented &&
|
||||
(siblings[siblings.indexOf(token) - 1]?.type === "blockQuotePrefix")
|
||||
) {
|
||||
const { startColumn, startLine, text } = token;
|
||||
const { length } = text;
|
||||
const line = params.lines[startLine - 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue