Update compile.go

This commit is contained in:
Bernard Xie 2023-06-01 18:42:43 -07:00
parent e40a65ae79
commit 3db70bb31d
No known key found for this signature in database
GPG key ID: 3C3E0036CE0F892C

View file

@ -270,6 +270,9 @@ func (c *compiler) compileLabel(attrs *d2graph.Attributes, f d2ir.Node) {
// TODO: Delete instead.
attrs.Label.Value = scalar.ScalarString()
case *d2ast.BlockString:
if scalar.ScalarString() == "" {
c.errorf(f.LastPrimaryKey(), "block string cannot be empty")
}
attrs.Language = scalar.Tag
fullTag, ok := ShortToFullLanguageAliases[scalar.Tag]
if ok {