mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Make MD033/no-inline-html slightly more efficient.
This commit is contained in:
parent
73e70b76f3
commit
fa40084994
1 changed files with 7 additions and 5 deletions
12
lib/md033.js
12
lib/md033.js
|
|
@ -30,11 +30,13 @@ module.exports = {
|
|||
!tag.endsWith("\\>") && !bareUrlRe.test(content) &&
|
||||
!emailAddressRe.test(content)) {
|
||||
const prefix = line.substring(0, match.index);
|
||||
if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix) &&
|
||||
!unescapeMarkdown(prefix + "<", "_").endsWith("_") &&
|
||||
(unescapeMarkdown(prefix + "`", "_").match(/`/g).length % 2)) {
|
||||
addError(onError, lineIndex + 1, "Element: " + element,
|
||||
null, [ match.index + 1, tag.length ]);
|
||||
if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix)) {
|
||||
const unescaped = unescapeMarkdown(prefix + "<", "_");
|
||||
if (!unescaped.endsWith("_") &&
|
||||
((unescaped + "`").match(/`/g).length % 2)) {
|
||||
addError(onError, lineIndex + 1, "Element: " + element,
|
||||
null, [ match.index + 1, tag.length ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue