mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-21 16:30:12 +01:00
Reimplement inlineCodeSpanRanges as codeBlockAndSpanRanges to fix an issue with unterminated code spans (and for flexibility).
This commit is contained in:
parent
9c60343692
commit
1e82f76596
12 changed files with 178 additions and 71 deletions
|
|
@ -5,7 +5,7 @@
|
|||
const {
|
||||
addError, forEachLine, overlapsAnyRange, unescapeMarkdown
|
||||
} = require("../helpers");
|
||||
const { inlineCodeSpanRanges, lineMetadata } = require("./cache");
|
||||
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
|
||||
|
||||
const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g;
|
||||
const linkDestinationRe = /]\(\s*$/;
|
||||
|
|
@ -22,7 +22,7 @@ module.exports = {
|
|||
let allowedElements = params.config.allowed_elements;
|
||||
allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
|
||||
allowedElements = allowedElements.map((element) => element.toLowerCase());
|
||||
const exclusions = inlineCodeSpanRanges();
|
||||
const exclusions = codeBlockAndSpanRanges();
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
||||
let match = null;
|
||||
// eslint-disable-next-line no-unmodified-loop-condition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue