mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD053/link-image-reference-definitions to handle multi-line references inside blockquotes (fixes #544).
This commit is contained in:
parent
5544ea54d7
commit
2c3e8c938b
6 changed files with 68 additions and 21 deletions
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorContext, isBlankLine } = require("../helpers");
|
||||
const { addErrorContext, blockquotePrefixRe, isBlankLine } =
|
||||
require("../helpers");
|
||||
const { flattenedLists } = require("./cache");
|
||||
|
||||
const quotePrefixRe = /^[>\s]*/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD032", "blanks-around-lists" ],
|
||||
"description": "Lists should be surrounded by blank lines",
|
||||
|
|
@ -18,7 +17,7 @@ module.exports = {
|
|||
const firstIndex = list.open.map[0];
|
||||
if (!isBlankLine(lines[firstIndex - 1])) {
|
||||
const line = lines[firstIndex];
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
const quotePrefix = line.match(blockquotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(
|
||||
onError,
|
||||
firstIndex + 1,
|
||||
|
|
@ -33,7 +32,7 @@ module.exports = {
|
|||
const lastIndex = list.lastLineIndex - 1;
|
||||
if (!isBlankLine(lines[lastIndex + 1])) {
|
||||
const line = lines[lastIndex];
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
const quotePrefix = line.match(blockquotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(
|
||||
onError,
|
||||
lastIndex + 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue