feat: add sandboxLinkBaseUrl for relative links in sandbox mode#7595
Open
jmandel wants to merge 2 commits intomermaid-js:developfrom
Open
feat: add sandboxLinkBaseUrl for relative links in sandbox mode#7595jmandel wants to merge 2 commits intomermaid-js:developfrom
jmandel wants to merge 2 commits intomermaid-js:developfrom
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. |
4 tasks
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
4 tasks
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.
📑 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:.