diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 4718636c5..0825166d6 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -533,8 +533,8 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) { } if attrs.Link != nil && attrs.Tooltip != nil { - _, err := url.ParseRequestURI(attrs.Tooltip.Value) - if err == nil { + u, err := url.ParseRequestURI(attrs.Tooltip.Value) + if err == nil && u.Host != "" { c.errorf(scalar, "Tooltip cannot be set to URL when link is also set (for security)") } }