commit
577f419d01
3 changed files with 21 additions and 1 deletions
|
|
@ -28,6 +28,8 @@
|
||||||
- fixes inconsistencies when objects were double quoted [#2390](https://github.com/terrastruct/d2/pull/2390)
|
- fixes inconsistencies when objects were double quoted [#2390](https://github.com/terrastruct/d2/pull/2390)
|
||||||
- fixes globs not applying to spread substitutions [#2426](https://github.com/terrastruct/d2/issues/2426)
|
- fixes globs not applying to spread substitutions [#2426](https://github.com/terrastruct/d2/issues/2426)
|
||||||
- fixes panic when classes were mixed with layers incorrectly [#2448](https://github.com/terrastruct/d2/pull/2448)
|
- fixes panic when classes were mixed with layers incorrectly [#2448](https://github.com/terrastruct/d2/pull/2448)
|
||||||
|
- Formatter:
|
||||||
|
- fixes substitutions in quotes surrounded by text [#2462](https://github.com/terrastruct/d2/pull/2462)
|
||||||
- CLI: fetch and render remote images of mimetype octet-stream correctly [#2370](https://github.com/terrastruct/d2/pull/2370)
|
- CLI: fetch and render remote images of mimetype octet-stream correctly [#2370](https://github.com/terrastruct/d2/pull/2370)
|
||||||
- Composition: spread importing scenarios/steps was not inheriting correctly [#2460](https://github.com/terrastruct/d2/pull/2460)
|
- Composition: spread importing scenarios/steps was not inheriting correctly [#2460](https://github.com/terrastruct/d2/pull/2460)
|
||||||
- Markdown: fixes nested var substitutions not working [#2456](https://github.com/terrastruct/d2/pull/2456)
|
- Markdown: fixes nested var substitutions not working [#2456](https://github.com/terrastruct/d2/pull/2456)
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ func (p *printer) blockComment(bc *d2ast.BlockComment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *printer) interpolationBoxes(boxes []d2ast.InterpolationBox, isDoubleString bool) {
|
func (p *printer) interpolationBoxes(boxes []d2ast.InterpolationBox, isDoubleString bool) {
|
||||||
for _, b := range boxes {
|
for i, b := range boxes {
|
||||||
if b.Substitution != nil {
|
if b.Substitution != nil {
|
||||||
p.substitution(b.Substitution)
|
p.substitution(b.Substitution)
|
||||||
continue
|
continue
|
||||||
|
|
@ -140,6 +140,11 @@ func (p *printer) interpolationBoxes(boxes []d2ast.InterpolationBox, isDoubleStr
|
||||||
s = escapeUnquotedValue(*b.String, p.inKey)
|
s = escapeUnquotedValue(*b.String, p.inKey)
|
||||||
}
|
}
|
||||||
b.StringRaw = &s
|
b.StringRaw = &s
|
||||||
|
} else if i > 0 && boxes[i-1].Substitution != nil {
|
||||||
|
// If this string follows a substitution, we need to make sure to use
|
||||||
|
// the actual string content, not the raw value which might be incorrect
|
||||||
|
s := *b.String
|
||||||
|
b.StringRaw = &s
|
||||||
}
|
}
|
||||||
if !isDoubleString {
|
if !isDoubleString {
|
||||||
if _, ok := d2ast.ReservedKeywords[strings.ToLower(*b.StringRaw)]; ok {
|
if _, ok := d2ast.ReservedKeywords[strings.ToLower(*b.StringRaw)]; ok {
|
||||||
|
|
|
||||||
|
|
@ -892,6 +892,19 @@ scenarios: {}
|
||||||
steps: asdf
|
steps: asdf
|
||||||
`,
|
`,
|
||||||
exp: `k
|
exp: `k
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "vars",
|
||||||
|
in: `vars: {
|
||||||
|
a: "a"
|
||||||
|
b: "X${a})"
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
exp: `vars: {
|
||||||
|
a: "a"
|
||||||
|
b: "X${a})"
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue