d2: Add trailing newline to svg output
The convention. Also makes log messages clearer when input/output is - as without the newline, you get this occasionally: </style><style type="text/css"><![CDATA[]]></style></svg>success: successfully compiled - to -
This commit is contained in:
parent
1eeedb7fd8
commit
cffb29c919
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
|
@ -243,6 +243,10 @@ func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, pad,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return svg, false, err
|
return svg, false, err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if len(out) > 0 && out[len(out)-1] != '\n' {
|
||||||
|
out = append(out, '\n')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ms.WritePath(outputPath, out)
|
err = ms.WritePath(outputPath, out)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue