diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 8c60316cd..1c83edf99 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -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 {