Update bare URL RegExp to improve the behavior of MD034/no-bare-urls with trailing punctuation (fixes #283).

This commit is contained in:
David Anson 2020-06-21 21:47:32 -07:00
parent e696960aab
commit 6ac5fa52a6
4 changed files with 119 additions and 1 deletions

View file

@ -21,7 +21,7 @@ const inlineCommentRe =
module.exports.inlineCommentRe = inlineCommentRe;
// Regular expressions for range matching
module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*/ig;
module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig;
module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;