mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-01 13:38:49 +01:00
Update MD013/line-length to allow inline image links to exceed the length threshold (fixes #248).
This commit is contained in:
parent
74af9f82fb
commit
26ad0550ec
2 changed files with 20 additions and 3 deletions
|
|
@ -10,10 +10,11 @@ const longLineRePrefix = "^.{";
|
|||
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
||||
const longLineRePostfixStrict = "}.+$";
|
||||
const labelRe = /^\s*\[.*[^\\]]:/;
|
||||
const linkOnlyLineRe = /^[es]*lT?L[ES]*$/;
|
||||
const linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/;
|
||||
const tokenTypeMap = {
|
||||
"em_open": "e",
|
||||
"em_close": "E",
|
||||
"image": "I",
|
||||
"link_open": "l",
|
||||
"link_close": "L",
|
||||
"strong_open": "s",
|
||||
|
|
@ -59,7 +60,7 @@ module.exports = {
|
|||
childTokenTypes += tokenTypeMap[child.type] || "x";
|
||||
}
|
||||
});
|
||||
if (linkOnlyLineRe.test(childTokenTypes)) {
|
||||
if (linkOrImageOnlyLineRe.test(childTokenTypes)) {
|
||||
linkOnlyLineNumbers.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue