diff --git a/main.go b/main.go index f37c40c0a..ce2af7899 100644 --- a/main.go +++ b/main.go @@ -243,6 +243,10 @@ func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, pad, if err != nil { return svg, false, err } + } else { + if len(out) > 0 && out[len(out)-1] != '\n' { + out = append(out, '\n') + } } err = ms.WritePath(outputPath, out)