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
|
|
@ -23,8 +23,9 @@ const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^`>]*)?)\/?>/g;
|
|||
module.exports.htmlElementRe = htmlElementRe;
|
||||
|
||||
// Regular expressions for range matching
|
||||
module.exports.bareUrlRe =
|
||||
/(?:http|ftp)s?:\/\/[^\s\]<>"'`]*(?:\/|[^\s\]<>"'`\W])/ig;
|
||||
module.exports.urlRe =
|
||||
// eslint-disable-next-line max-len
|
||||
/(?:http|ftp)s?:\/\/(?:[^\s()<>\]"'`]|\([^\s<>\]"'`]*\))*\b(?:[-#/]|\([^\s<>\]"'`]*\))*/ig;
|
||||
module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
|
||||
module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue