Parse every <!-- mermaid-lint-disable-file ... --> directive in a Markdown
document. Document-level directives carry the real 1-indexed document line
the directive keyword starts on (not the line of any particular Mermaid
block) — they apply to every block regardless of position.
An HTML comment whose opening <!-- falls inside a fenced code block or an
inline code span is skipped entirely — see codeRanges. That is what
keeps documentation showing the directive syntax (e.g. this project's own
README) from being parsed as a live directive.
A single HTML comment may pack more than one directive (e.g. copy-pasted
blocks or several independent suppressions). Each occurrence of any
directive keyword starts its own directive; the text between consecutive
occurrences (and from the last occurrence to the end of the comment) is
that directive's rule list and reason. This avoids silently folding a
second directive into the first one's reason string. Keywords other than
-disable-file are also scanned for here (not skipped) so a keyword used
at the wrong scope — e.g. <!-- mermaid-lint-disable-next-line ... --> —
is reported via wrong-scope instead of silently doing nothing.
Parse every
<!-- mermaid-lint-disable-file ... -->directive in a Markdown document. Document-level directives carry the real 1-indexed document line the directive keyword starts on (not the line of any particular Mermaid block) — they apply to every block regardless of position.An HTML comment whose opening
<!--falls inside a fenced code block or an inline code span is skipped entirely — see codeRanges. That is what keeps documentation showing the directive syntax (e.g. this project's own README) from being parsed as a live directive.A single HTML comment may pack more than one directive (e.g. copy-pasted blocks or several independent suppressions). Each occurrence of any directive keyword starts its own directive; the text between consecutive occurrences (and from the last occurrence to the end of the comment) is that directive's rule list and reason. This avoids silently folding a second directive into the first one's
reasonstring. Keywords other than-disable-fileare also scanned for here (not skipped) so a keyword used at the wrong scope — e.g.<!-- mermaid-lint-disable-next-line ... -->— is reported viawrong-scopeinstead of silently doing nothing.