mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Rename helpers.bareUrlRe to urlRe, improve it a little, add tests
This commit is contained in:
parent
6e38259a4a
commit
2e2937081e
5 changed files with 103 additions and 16 deletions
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
|
||||
forEachLink, withinAnyRange, linkReferenceDefinitionRe } =
|
||||
require("../helpers");
|
||||
const { addErrorDetailIf, escapeForRegExp, forEachLine, forEachLink,
|
||||
linkReferenceDefinitionRe, urlRe, withinAnyRange } = require("../helpers");
|
||||
const { codeBlockAndSpanRanges, htmlElementRanges, lineMetadata } =
|
||||
require("./cache");
|
||||
|
||||
|
|
@ -28,7 +27,7 @@ module.exports = {
|
|||
exclusions.push([ lineIndex, 0, line.length ]);
|
||||
} else {
|
||||
let match = null;
|
||||
while ((match = bareUrlRe.exec(line)) !== null) {
|
||||
while ((match = urlRe.exec(line)) !== null) {
|
||||
exclusions.push([ lineIndex, match.index, match[0].length ]);
|
||||
}
|
||||
forEachLink(line, (index, _, text, destination) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue