Repository navigation
Pin and conditionally load Mermaid in styled HTML exports - #204
Merged
Merged
Conversation
Closes #203 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation addresses conditional loading and version pinning with appropriate build and export coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Pins Mermaid’s CDN version and loads it only when styled HTML contains Mermaid content.
Changes:
- Defines the installed Mermaid version at build/test time.
- Conditionally injects the Mermaid module loader.
- Adds comprehensive export and build-variant tests.
| File | Description |
|---|---|
src/render.ts |
Detects Mermaid elements before adding the pinned loader. |
types/env.d.ts |
Declares the Mermaid version build constant. |
vite.config.mts |
Injects the installed Mermaid version during builds. |
vitest.config.ts |
Injects the version during tests. |
tests/render.styles.test.ts |
Tests conditional and pinned loading across exports. |
tests/build.test.ts |
Verifies lite builds exclude the CDN dependency. |
dist/markedit-preview.js |
Synchronizes the generated full-build artifact. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Closes #203.