Repository navigation
Fix d2.js startup in Safari workers with Goldmark v2 - #2965
Merged
Merged
Conversation
Use Goldmark's v2 parser and renderer for Markdown. Wait for Go to export the D2 API before reporting worker readiness, and propagate startup failures to callers. - sent from alixander's Codex
Six native SVG font data URIs already contain the original TrueType face. Decode those bytes into the public font registry and embed separate TTFs only for the four WOFF encodings. All twelve face and data URI digests match master, including the two hand-drawn style aliases. The Intel macOS release binary falls from 45,185,936 to 44,157,776 bytes with the Goldmark upgrade. The release limit is 45,000,000 bytes. - sent from alixander's Codex
Include the animated appendix change and preserve both d2.js changelog entries. - sent from alixander's Codex
This was referenced Nov 19, 2026
Closed
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.
Human
AI
Fixes #2956. Thanks to @nelsonjchen for tracing the Safari worker crash to Goldmark's URL regexes in #2960.
Upgrade to Goldmark v2.1.16, which scans URLs without compiling those regexes during startup. D2 continues to use the upstream table and strikethrough extensions. The browser and Node workers now wait for Go to export the D2 API. If Go exits or throws first,
D2.readyrejects with the startup error.One Markdown edge case changes. A list item followed by a
--line, a blank line, and another paragraph now stays a list. The previous version rendered the item as a table.The Goldmark upgrade pushed the Intel macOS binary over the 45 MB release limit. Native builds now reuse the SVG font data for six faces whose data URIs already contain the original TTF. All 12 registered font faces and SVG encodings match master byte for byte, including the two style aliases. The resulting Intel macOS binary is 44,170,064 bytes, down from 44,973,600 on master (
7d48324).Verification
D2.ready.@d2lang/[email protected]and pass against this branch. The JavaScript type checks, unit tests, and installed-package integration tests passed.The Playground can pick up the change in the next d2.js release. See d2lang/d2-playground#113.