Skip to content

compiler: fix variable resolution in templates, globs, Markdown links and steps - #3060

Merged
alixander merged 1 commit into
masterfrom
fix-variable-scope-filters-and-tweens
Nov 26, 2026
Merged

alixander merged 1 commit into
masterfrom
fix-variable-scope-filters-and-tweens

Conversation

@alixander

Copy link
Copy Markdown
Collaborator

Human


AI

Fix seven variable-handling bugs in compilation, Markdown links, and animated steps.

  • Resolve forward dependencies before reading them. Map templates keep their declaration scope when used in multiple containers, and a local alias such as host: ${db.host} reads the local db.host.
  • Compare resolved values on both sides of glob filters, including references in labels. Preserve the source order of filter effects and explicit assignments.
  • Substitute Markdown link destinations and titles, including reference definitions shared by multiple links. Preserve code samples and keep spaces and punctuation inside the link.
  • Locate step variables by their full container path and use ordinary quoted-key lookup when finding the starting value. Local-only changes produce intermediate frames, including in selected imports.

Verified all seven reproductions and their controls using compiled labels, styles, SVG link destinations, and animation samples. The 89 checked-in D2 fixtures produced identical compiler and formatter results to the base revision.

  • sent from alixander's Codex

@alixander
alixander force-pushed the fix-variable-scope-filters-and-tweens branch from d139b3e to e98e183 Compare November 26, 2026 14:49
@alixander
alixander merged commit 74d5193 into master Nov 26, 2026
11 checks passed
@alixander
alixander deleted the fix-variable-scope-filters-and-tweens branch November 26, 2026 14:58
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant