mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update MD013/line-length to permit long link/image reference definitions in all modes because they can not be easily split.
This commit is contained in:
parent
fe1e93e20d
commit
99a3f164a9
11 changed files with 206 additions and 25 deletions
|
|
@ -797,6 +797,7 @@ function getReferenceLinkImageData(lineMetadata) {
|
|||
const shortcuts = new Set();
|
||||
const definitions = new Map();
|
||||
const duplicateDefinitions = [];
|
||||
const definitionLineIndices = [];
|
||||
// Define helper functions
|
||||
const normalizeLabel = (s) => s.toLowerCase().trim().replace(/\s+/g, " ");
|
||||
const exclusions = [];
|
||||
|
|
@ -838,6 +839,11 @@ function getReferenceLinkImageData(lineMetadata) {
|
|||
}
|
||||
const labelLength = linkReferenceDefinitionMatch[0].length;
|
||||
exclusions.push([ 0, lineOffsets[lineIndex], labelLength ]);
|
||||
const hasDefinition = line.slice(labelLength).trim().length > 0;
|
||||
definitionLineIndices.push(lineIndex);
|
||||
if (!hasDefinition) {
|
||||
definitionLineIndices.push(lineIndex + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -914,7 +920,8 @@ function getReferenceLinkImageData(lineMetadata) {
|
|||
references,
|
||||
shortcuts,
|
||||
definitions,
|
||||
duplicateDefinitions
|
||||
duplicateDefinitions,
|
||||
definitionLineIndices
|
||||
};
|
||||
}
|
||||
module.exports.getReferenceLinkImageData = getReferenceLinkImageData;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue