markdownlint
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -9,4 +9,9 @@ // @ts-check | ||
const htmlElementRe = /<(\w+)(?:[^>]*)?>/g; | ||
const htmlElementRe = /<(([\w-]+)(?:[\s/][^>]*)?)>/g; | ||
const linkDestinationRe = /]\(\s*$/; | ||
const inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/; | ||
// See https://spec.commonmark.org/0.29/#autolinks | ||
const emailAddressRe = | ||
// eslint-disable-next-line max-len | ||
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; | ||
@@ -24,7 +29,8 @@ module.exports = { | ||
while (!inCode && (match = htmlElementRe.exec(line))) { | ||
const [ tag, element ] = match; | ||
const [ tag, content, element ] = match; | ||
if (!allowedElements.includes(element.toLowerCase()) && | ||
!tag.endsWith("\\>") && !bareUrlRe.test(tag)) { | ||
!tag.endsWith("\\>") && !bareUrlRe.test(content) && | ||
!emailAddressRe.test(content)) { | ||
const prefix = line.substring(0, match.index); | ||
if (!linkDestinationRe.test(prefix) && | ||
if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix) && | ||
!unescapeMarkdown(prefix + "<", "_").endsWith("_")) { | ||
@@ -31,0 +37,0 @@ addError(onError, lineIndex + 1, "Element: " + element, |
{ | ||
"name": "markdownlint", | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.", | ||
@@ -5,0 +5,0 @@ "main": "lib/markdownlint.js", |
@@ -754,2 +754,3 @@ # markdownlint | ||
in-browser demo, update dependencies. | ||
* 0.14.1 - Improve MD033. | ||
@@ -756,0 +757,0 @@ [npm-image]: https://img.shields.io/npm/v/markdownlint.svg |
@@ -0,0 +0,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4259
764
219849