Repository navigation
fix(blazor): vendor mermaid, MathJax, highlight.js, github-markdown-css - #1552
Merged
Merged
Conversation
…wn-css — no more CDN loads at view time Five view-time CDN references made diagrams, math, code highlighting, and markdown styling silently break on networks that block public CDNs — and the mermaid URL was UNPINNED (unpkg /mermaid/dist: every visitor got whatever shipped last). All four libraries now ship as static web assets under _content/MeshWeaver.Blazor/lib (the mammoth/pdfjs-dist precedent), pinned: mermaid 11.12.1, MathJax 3.2.2, highlight.js 11.11.1 (+ github themes), github-markdown-css 5.8.1. Seven call sites rewritten; zero external script/style URLs remain in the Blazor trees. Remaining CDN reference (deliberately separate): the MAUI client's Monaco loader (memex/Memex.Client/Pages/MonacoEditorView.cs) needs the BlazorMonaco assets served inside the BlazorWebView — its own change. Verified: MeshWeaver.Blazor.Portal builds -c Release -warnaserror clean (0 Errors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes runtime CDN dependencies for Mermaid, MathJax, highlight.js, and GitHub Markdown CSS in the Blazor portal by vendoring pinned copies as static web assets under _content/MeshWeaver.Blazor/lib, improving reliability on locked-down networks.
Changes:
- Vendored pinned versions of highlight.js and GitHub Markdown CSS (plus themes) into
wwwroot/lib. - Updated multiple Blazor JS call sites to load Mermaid/MathJax/Markdown CSS from
_content/...instead of public CDNs. - Added a “What’s New” entry documenting the offline rendering fix.
Reviewed changes
Copilot reviewed 7 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/MeshWeaver.Documentation/Data/WhatsNew/2026-08-14-offline-diagram-math-rendering.md | Adds release note describing offline-friendly rendering. |
| src/MeshWeaver.Blazor/wwwroot/lib/highlightjs/styles/github.min.css | Adds vendored highlight.js GitHub light theme. |
| src/MeshWeaver.Blazor/wwwroot/lib/highlightjs/styles/github-dark.min.css | Adds vendored highlight.js GitHub dark theme. |
| src/MeshWeaver.Blazor/wwwroot/lib/highlightjs/highlight.min.js | Adds vendored highlight.js runtime. |
| src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown.min.css | Adds vendored GitHub Markdown CSS (base). |
| src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown-light.min.css | Adds vendored GitHub Markdown CSS (light). |
| src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown-dark.min.css | Adds vendored GitHub Markdown CSS (dark). |
| src/MeshWeaver.Blazor/wwwroot/highlightUtils.js | Switches highlight.js loader from CDN to vendored static assets. |
| src/MeshWeaver.Blazor/Components/Mermaid.razor.js | Switches Mermaid loader from CDN to vendored static assets. |
| src/MeshWeaver.Blazor/Components/MathBlock.razor.js | Switches MathJax loader from CDN to vendored static assets. |
| src/MeshWeaver.Blazor/Components/MarkdownView.razor.js | Switches markdown theme fallback path from CDN to vendored static assets. |
| src/MeshWeaver.Blazor/Components/CollaborativeMarkdownView.razor.js | Switches Mermaid/MathJax loading from CDN to vendored static assets. |
| src/MeshWeaver.Blazor.Portal/Layout/PortalLayoutBase.razor.js | Switches markdown theme fallback path from CDN to vendored static assets. |
Files not reviewed (5)
- src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown-dark.min.css: Generated file
- src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown-light.min.css: Generated file
- src/MeshWeaver.Blazor/wwwroot/lib/github-markdown-css/github-markdown.min.css: Generated file
- src/MeshWeaver.Blazor/wwwroot/lib/highlightjs/styles/github-dark.min.css: Generated file
- src/MeshWeaver.Blazor/wwwroot/lib/highlightjs/styles/github.min.css: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Contributor
Contributor
Contributor
Contributor
Contributor
Contributor
Contributor
Author
|
Review follow-ups in #1556 (sourcemap strips + naming). The mermaid window-attachment claim is falsified: the vendored bundle ends with |
rbuergi
added a commit
that referenced
this pull request
Aug 14, 2026
chore(blazor): vendored-asset polish from the #1552 review
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.
Part of the modularization program's asset-reference cleanup (the revisit of mermaid/mathjax/monaco refs).
Why: five view-time CDN loads silently broke diagrams, math, code highlighting, and markdown styling on locked-down networks — and the mermaid URL was unpinned (every visitor got whatever unpkg shipped last).
What: all four libraries ship as static web assets under
_content/MeshWeaver.Blazor/lib(the existing mammoth/pdfjs-dist pattern), pinned — mermaid 11.12.1, MathJax 3.2.2, highlight.js 11.11.1 + github themes, github-markdown-css 5.8.1. Seven call sites rewritten; grep confirms zero external script/style URLs remain in the Blazor trees.Deliberately out of scope: the MAUI client's Monaco CDN loader (
Memex.Client/Pages/MonacoEditorView.cs) — needs BlazorMonaco's assets served inside the BlazorWebView; follow-up.Verification:
MeshWeaver.Blazor.Portalbuilds-c Release -warnaserrorclean. What's New entry included (Fix).🤖 Generated with Claude Code