diff --git a/lib/md042.js b/lib/md042.js index 6d44df6b..8d152a98 100644 --- a/lib/md042.js +++ b/lib/md042.js @@ -31,6 +31,7 @@ module.exports = { addErrorContext(onError, child.lineNumber, "[" + linkText + "]()", null, null, rangeFromRegExp(child.line, emptyLinkRe)); + emptyLink = false; } } else if (inLink) { linkText += child.content; diff --git a/test/empty-links.md b/test/empty-links.md index ddd7caf0..a54971e5 100644 --- a/test/empty-links.md +++ b/test/empty-links.md @@ -61,3 +61,20 @@ [text] [text]: link + +## Inline of links with empty link (#308) + +[text](link-1) +[text]() {MD042} +[text](link-3) + +[text](link-1) +[text]() {MD042} +[text](link-3) +[text]() {MD042} + +[text](link-1) +[text]() {MD042} +[text](link-3) +[text]() {MD042} +[text](link-5)