Reimplement inlineCodeSpanRanges as codeBlockAndSpanRanges to fix an issue with unterminated code spans (and for flexibility).

This commit is contained in:
David Anson 2021-11-23 04:40:05 +00:00 committed by GitHub
parent 9c60343692
commit 1e82f76596
12 changed files with 178 additions and 71 deletions

View file

@ -4,7 +4,7 @@
const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
overlapsAnyRange, linkRe, linkReferenceRe } = require("../helpers");
const { inlineCodeSpanRanges, lineMetadata } = require("./cache");
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
module.exports = {
"names": [ "MD044", "proper-names" ],
@ -36,7 +36,7 @@ module.exports = {
}
});
if (!includeCodeBlocks) {
exclusions.push(...inlineCodeSpanRanges());
exclusions.push(...codeBlockAndSpanRanges());
}
for (const name of names) {
const escapedName = escapeForRegExp(name);