Replace helpers.overlapsAnyRange with .withinAnyRange, update code/tests for resulting behavior.

This commit is contained in:
David Anson 2022-06-02 22:17:32 -07:00
parent cb943a8718
commit 6718944b0f
10 changed files with 70 additions and 53 deletions

View file

@ -3,7 +3,7 @@
"use strict";
const {
addError, forEachLine, htmlElementRe, overlapsAnyRange, unescapeMarkdown
addError, forEachLine, htmlElementRe, withinAnyRange, unescapeMarkdown
} = require("../helpers");
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
@ -31,7 +31,7 @@ module.exports = {
!allowedElements.includes(element.toLowerCase()) &&
!tag.endsWith("\\>") &&
!emailAddressRe.test(content) &&
!overlapsAnyRange(exclusions, lineIndex, match.index, match[0].length)
!withinAnyRange(exclusions, lineIndex, match.index, match[0].length)
) {
const prefix = line.substring(0, match.index);
if (!linkDestinationRe.test(prefix)) {