Add MD052/reference-links-images and MD053/link-image-reference-definitions for reporting issues with link and image references (fixes #144, fixes #390, fixes #425, fixes #456).

This commit is contained in:
David Anson 2022-06-01 20:23:08 -07:00
parent 2c947abf7b
commit c5ca661b96
21 changed files with 1333 additions and 65 deletions

View file

@ -3,7 +3,8 @@
"use strict";
const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
forEachLink, overlapsAnyRange, linkReferenceRe } = require("../helpers");
forEachLink, overlapsAnyRange, linkReferenceDefinitionRe } =
require("../helpers");
const { codeBlockAndSpanRanges, htmlElementRanges, lineMetadata } =
require("./cache");
@ -23,7 +24,7 @@ module.exports = {
(htmlElements === undefined) ? true : !!htmlElements;
const exclusions = [];
forEachLine(lineMetadata(), (line, lineIndex) => {
if (linkReferenceRe.test(line)) {
if (linkReferenceDefinitionRe.test(line)) {
exclusions.push([ lineIndex, 0, line.length ]);
} else {
let match = null;