mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Improve highlighting for MD042/no-empty-links, add more tests.
This commit is contained in:
parent
3b42e00c60
commit
0fd322a380
3 changed files with 30 additions and 8 deletions
|
|
@ -8,7 +8,7 @@ var atxClosedHeaderSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
|
|||
var atxHeaderSpaceRe = /^#+\s*\S/;
|
||||
var bareUrlRe = /(?:http|ftp)s?:\/\/[^\s]*/i;
|
||||
var dollarCommandRe = /^(\s*)(\$\s)/;
|
||||
var emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))|(?:\[[^\]]*])/;
|
||||
var emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))/;
|
||||
var htmlRe = /<[^>]*>/;
|
||||
var listItemMarkerRe = /^[\s>]*(?:[*+-]|\d+\.)\s+/;
|
||||
var listItemMarkerInterruptsRe = /^[\s>]*(?:[*+-]|1\.)\s+/;
|
||||
|
|
@ -1113,7 +1113,7 @@ module.exports = [
|
|||
} else if (child.type === "link_close") {
|
||||
inLink = false;
|
||||
if (emptyLink) {
|
||||
errors.addContext(child.lineNumber, "[" + linkText + "]");
|
||||
errors.addContext(child.lineNumber, "[" + linkText + "]()");
|
||||
}
|
||||
} else if (inLink) {
|
||||
linkText += child.content;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue