Fix Mermaid style check to exempt diagram types without style directive support#1577
Merged
Fix Mermaid style check to exempt diagram types without style directive support#1577
Conversation
…agram Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/24683640-c41f-4dcb-a355-72d33cb1a1f1 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…es from style check Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/277b8bc9-9f8c-4f45-856c-a0cbf77bb7a3 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pethers
April 6, 2026 20:12
View session
Contributor
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: testing,size-xs Label Categories
For more information, see |
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the analysis quality validation so Mermaid diagram types that cannot use style directives (e.g. quadrantChart, pie) are no longer incorrectly flagged as “unstyled” in strict-v2 risk assessment files.
Changes:
- Added an
INHERENTLY_STYLED_MERMAIDregex to recognize Mermaid diagram types styled by the renderer rather thanstyledirectives. - Updated
hasMermaidStyling()to require that every Mermaid block is either explicitly styled or inherently styled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hasMermaidStyling()required explicitstyledirectives on all Mermaid blocks, but several Mermaid diagram types (quadrantChart,pie,gantt,gitGraph,timeline,mindmap,sankey) don't supportstyledirectives at all. This forced content authors to avoid these chart types in strict-v2 risk files.INHERENTLY_STYLED_MERMAIDpattern to recognize diagram types that are styled by the renderer, not by explicit directiveshasMermaidStyling()now usesevery— each block must be either explicitly styled OR an inherently-styled typeevening-analysis/risk-assessment.mdback toquadrantChart(better fit for risk matrices thangraph TD)