mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10: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
|
|
@ -3,8 +3,8 @@
|
|||
"use strict";
|
||||
|
||||
const { addErrorDetailIf, filterTokens, forEachHeading, forEachLine,
|
||||
includesSorted, linkReferenceDefinitionRe } = require("../helpers");
|
||||
const { lineMetadata } = require("./cache");
|
||||
includesSorted } = require("../helpers");
|
||||
const { lineMetadata, referenceLinkImageData } = require("./cache");
|
||||
|
||||
const longLineRePrefix = "^.{";
|
||||
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
||||
|
|
@ -67,6 +67,7 @@ module.exports = {
|
|||
linkOnlyLineNumbers.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
const { definitionLineIndices } = referenceLinkImageData();
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => {
|
||||
const lineNumber = lineIndex + 1;
|
||||
const isHeading = includesSorted(headingLineNumbers, lineNumber);
|
||||
|
|
@ -79,10 +80,10 @@ module.exports = {
|
|||
if ((includeCodeBlocks || !inCode) &&
|
||||
(includeTables || !inTable) &&
|
||||
(includeHeadings || !isHeading) &&
|
||||
!includesSorted(definitionLineIndices, lineIndex) &&
|
||||
(strict ||
|
||||
(!(stern && sternModeRe.test(line)) &&
|
||||
!includesSorted(linkOnlyLineNumbers, lineNumber) &&
|
||||
!linkReferenceDefinitionRe.test(line))) &&
|
||||
!includesSorted(linkOnlyLineNumbers, lineNumber))) &&
|
||||
lengthRe.test(line)) {
|
||||
addErrorDetailIf(
|
||||
onError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue