Update MD044/proper-names to ignore the content of HTML comments when its html_elements parameter is false (fixes #832).

This commit is contained in:
David Anson 2023-05-26 20:58:59 -07:00
parent 1b0e783c33
commit dc4acff067
6 changed files with 68 additions and 2 deletions

View file

@ -37,7 +37,9 @@ module.exports = {
(token) => {
let { children } = token;
if (!includeHtmlElements && (token.type === "htmlFlow")) {
children = children.slice(1, -1);
children = (children[0] && children[0].text === "<!--") ?
[] :
children.slice(1, -1);
}
return children.filter((t) => !ignoredChildTypes.has(t.type));
}