mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Hide the content of inline configuration HTML comments from the linting process to avoid false positives.
This commit is contained in:
parent
535aa1a2ee
commit
bbec8c5c1e
7 changed files with 80 additions and 40 deletions
|
@ -161,16 +161,10 @@ module.exports.clearHtmlCommentText = function clearHtmlCommentText(text) {
|
|||
!content.endsWith("-") && !content.includes("--"));
|
||||
// If a valid block/inline comment...
|
||||
if (isValid) {
|
||||
const inlineCommentIndex = text
|
||||
.slice(i, j + htmlCommentEnd.length)
|
||||
.search(inlineCommentStartRe);
|
||||
// If not a markdownlint inline directive...
|
||||
if (inlineCommentIndex !== 0) {
|
||||
text =
|
||||
text.slice(0, i + htmlCommentBegin.length) +
|
||||
content.replace(/[^\r\n]/g, ".") +
|
||||
text.slice(j);
|
||||
}
|
||||
text =
|
||||
text.slice(0, i + htmlCommentBegin.length) +
|
||||
content.replace(/[^\r\n]/g, ".") +
|
||||
text.slice(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue