feat: add sandboxLinkBaseUrl for relative links in sandbox mode#7594
feat: add sandboxLinkBaseUrl for relative links in sandbox mode#7594jmandel wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 6cfd2ae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7594 +/- ##
==========================================
- Coverage 3.33% 3.33% -0.01%
==========================================
Files 536 537 +1
Lines 56249 56287 +38
Branches 820 821 +1
==========================================
Hits 1876 1876
- Misses 54373 54411 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
Superseded by #7595, which uses a Mermaid-convention branch name and updated PR metadata. Closing this draft to keep review on the replacement PR. |
📑 Summary
Add
sandboxLinkBaseUrlto resolve relative links whensecurityLevel: 'sandbox'renders diagrams inside a sandboxeddata:iframe.Relative links such as
./page.htmland#sectionlose their base URL context in that environment. This PR adds an opt-in configuration option so Mermaid can resolve those links before embedding the SVG.📏 Design Decisions
sandboxLinkBaseUrl; existing sandbox behavior stays unchanged unless the option is set.hrefandxlink:hrefon<a>) so Mermaid does not touch internal SVG references such as markers or symbols.Verification
v<MERMAID_RELEASE_VERSION>+.minor)../details.htmland#resultslinks resolve correctly whensandboxLinkBaseUrlis set.📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.