Detect whether a Mermaid diagram body already declares its own theme.
Matches the same heuristics used by Check 5 of .github/prompts/05-analysis-gate.md:
.github/prompts/05-analysis-gate.md
%%{init โฆ}%%
themeVariables
style โฆ
classDef โฆ
linkStyle โฆ
If any of these are present, the renderer leaves the diagram alone. Otherwise it prepends CANONICAL_MERMAID_INIT.
Detect whether a Mermaid diagram body already declares its own theme.
Matches the same heuristics used by Check 5 of
.github/prompts/05-analysis-gate.md:%%{init โฆ}%%prologue, orthemeVariablesdeclaration anywhere in the body, orstyle โฆdirective (per-node colours), orclassDef โฆdirective (per-class colours), orlinkStyle โฆdirective (per-link colours).If any of these are present, the renderer leaves the diagram alone. Otherwise it prepends CANONICAL_MERMAID_INIT.