mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
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:
parent
2c947abf7b
commit
c5ca661b96
21 changed files with 1333 additions and 65 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue