mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-29 20:18:49 +01:00
Cache results of inlineCodeSpanRanges for use by MD011/MD044.
This commit is contained in:
parent
706f48bd25
commit
7d40926367
6 changed files with 56 additions and 39 deletions
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addError, forEachLine, inlineCodeSpanRanges, overlapsAnyRange } =
|
||||
require("../helpers");
|
||||
const { lineMetadata } = require("./cache");
|
||||
const { addError, forEachLine, overlapsAnyRange } = require("../helpers");
|
||||
const { inlineCodeSpanRanges, lineMetadata } = require("./cache");
|
||||
|
||||
const reversedLinkRe =
|
||||
/(?<![\\\]])\(([^)]+)(?<!\\)\)\[([^\]^][^\]]*)(?<!\\)](?!\()/g;
|
||||
|
|
@ -14,7 +13,7 @@ module.exports = {
|
|||
"description": "Reversed link syntax",
|
||||
"tags": [ "links" ],
|
||||
"function": function MD011(params, onError) {
|
||||
const exclusions = inlineCodeSpanRanges(params.lines);
|
||||
const exclusions = inlineCodeSpanRanges();
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
|
||||
if (!inCode && !onFence) {
|
||||
let match = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue