Repository navigation
Conversation
… drives The preview and PDF export loaded HTML with the document's directory as the WKWebView baseURL. When that directory is on a different volume (external drive), WebKit refuses to load the bundled file: JS/CSS subresources, so mermaid diagrams fell back to plain code blocks. Local images go through LocalImageSchemeHandler and relative links resolve in Swift, so nothing needs the document baseURL — use the bundle resource directory like QuickLook already does. Fixes #409
Same fix as the Mac preview: a document-directory baseURL on another volume or file provider blocks the bundled file: JS/CSS subresources (mermaid, katex, highlight).
Deploying clearly with
|
| Latest commit: |
58939cb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5f1ee1d5.clearly-cjz.pages.dev |
| Branch Preview URL: | https://issue-409.clearly-cjz.pages.dev |
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.
Fixes #409
The preview (Mac + iOS), PDF export, and iOS QuickLook extension loaded HTML with the document's directory as the WKWebView baseURL. When the document lives on a different volume (external drive, or a file provider on iOS), WebKit refuses to load the bundled
file:JS/CSS subresources — mermaid, KaTeX, and highlight.js — so mermaid diagrams rendered as plain code blocks. Mac QuickLook already used the bundle resource directory as baseURL, which is why spacebar preview worked on the external drive.Nothing actually needs the document-directory baseURL anymore: local images go through
LocalImageSchemeHandler, and relative links resolve in Swift againstfileURL. All four load sites now useMermaidSupport.resourceBaseURL.Verification
) plus a mermaid block renders both correctly.swift test --package-path Packages/ClearlyCoregreen; Mac and iOS targets build.