Update MD013/line-length to allow inline image links to exceed the length threshold (fixes #248).

This commit is contained in:
David Anson 2020-01-24 21:50:50 -08:00
parent 74af9f82fb
commit 26ad0550ec
2 changed files with 20 additions and 3 deletions

View file

@ -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);
}
});