mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00: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
|
|
@ -30,6 +30,10 @@ module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
|||
// Regular expression for all instances of emphasis markers
|
||||
const emphasisMarkersRe = /[_*]/g;
|
||||
|
||||
// Regular expression for blockquote prefixes
|
||||
const blockquotePrefixRe = /^[>\s]*/;
|
||||
module.exports.blockquotePrefixRe = blockquotePrefixRe;
|
||||
|
||||
// Regular expression for reference links (full, collapsed, and shortcut)
|
||||
const referenceLinkRe =
|
||||
/!?\\?\[((?:\[[^\]\0]*]|[^\]\0])*)](?:(?:\[([^\]\0]*)\])|([^(])|$)/g;
|
||||
|
|
@ -794,6 +798,7 @@ function getReferenceLinkImageData(lineMetadata) {
|
|||
forEachLine(lineMetadata, (line, lineIndex, inCode) => {
|
||||
lineOffsets[lineIndex] = currentOffset;
|
||||
if (!inCode) {
|
||||
line = line.replace(blockquotePrefixRe, "");
|
||||
if (line.trim().length === 0) {
|
||||
// Allow RegExp to detect the end of a block
|
||||
line = "\0";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue