Repository navigation
Use regular D2 variable scoping in Markdown - #3057
Merged
Merged
Conversation
- sent from alixander's Codex
- sent from alixander's Codex
alixander
added a commit
that referenced
this pull request
Nov 26, 2026
Master resolves Markdown variables with D2's scope rules and fixes variable resolution in templates, globs, Markdown links and steps (#3057, #3060); lib/textmeasure now does the substitution, so d2ir/compile.go no longer imports it and keeps this branch's htmlentity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Markdown labels now resolve D2 variable references using the same lexical lookup as plain labels. A container can override a root variable, a missing path can fall back to an outer scope, and quoted keyword names retain their distinct bindings.
A nested variable such as
db.hostis addressed by its full path. Markdown code spans, fenced code, and unresolved placeholders stay literal. Imported modules and interpolated animation frames keep already-substituted text literal while resolving their remaining references in the appropriate scope.