mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Add support for disabling/enabling rules within Markdown content (fixes #5).
This commit is contained in:
parent
071bba88fc
commit
31141cc3ed
10 changed files with 192 additions and 42 deletions
13
lib/rules.js
13
lib/rules.js
|
|
@ -640,12 +640,13 @@ module.exports = [
|
|||
"desc": "Inline HTML",
|
||||
"tags": [ "html" ],
|
||||
"func": function MD033(params, errors) {
|
||||
filterTokens(params, "html_block", function forToken(token) {
|
||||
errors.push(token.lineNumber);
|
||||
});
|
||||
forEachInlineChild(params, "html_inline", function forToken(token) {
|
||||
errors.push(token.lineNumber);
|
||||
});
|
||||
function forToken(token) {
|
||||
if (token.content.search(shared.inlineCommentRe) === -1) {
|
||||
errors.push(token.lineNumber);
|
||||
}
|
||||
}
|
||||
filterTokens(params, "html_block", forToken);
|
||||
forEachInlineChild(params, "html_inline", forToken);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue