mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
Allow HTML comments containing "--" even though it is not allowed by the CommonMark specification because it is allowed by the HTML specification and it happens in real life (fixes #996).
This commit is contained in:
parent
d2faf40e6a
commit
6eca6f1c3d
5 changed files with 53 additions and 3 deletions
|
|
@ -42,8 +42,13 @@ function isHtmlFlowComment(token) {
|
|||
return (
|
||||
!comment.startsWith(">") &&
|
||||
!comment.startsWith("->") &&
|
||||
!comment.endsWith("-") &&
|
||||
!comment.includes("--")
|
||||
!comment.endsWith("-")
|
||||
// The following condition from the CommonMark specification is commented
|
||||
// to avoid parsing HTML comments that include "--" because that is NOT a
|
||||
// condition of the HTML specification.
|
||||
// https://spec.commonmark.org/0.30/#raw-html
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#comments
|
||||
// && !comment.includes("--")
|
||||
);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue