Add mermaid diagram sanitization to wiki push step#284
Merged
Conversation
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix rendering issues in mermaid diagrams in Agentic Wiki Writer
Add mermaid diagram sanitization to wiki push step
Mar 18, 2026
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.
GitHub's wiki mermaid renderer rejects two syntax patterns the AI model occasionally generates, causing "Unable to render rich display" errors. This adds a post-processing sanitization step that fixes these patterns before committing wiki pages.
Changes
push-wikisafe-output job, running between "Write wiki pages" and "Commit and push"A["`text`"]→A["text"])\nescape sequences within backtick labels (A["`prefix`\nextra"]→A["prefix extra"])\nescape sequences in labels with spacesExample
Before (causes lexer error):
After sanitization:
This acts as a reliable safety net regardless of what the model generates, since the existing self-review checklist instructions alone are insufficient to prevent the issue.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.