data-d2-version

This commit is contained in:
Alexander Wang 2025-01-26 12:02:12 -07:00
parent 87ce08c6b7
commit d0294d4d4f
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927

View file

@ -2112,7 +2112,7 @@ func Render(diagram *d2target.Diagram, opts *RenderOpts) ([]byte, error) {
tag := "g"
// Many things change when this is rendering for animation
if opts.MasterID == "" {
fitToScreenWrapperOpening = fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="%s" preserveAspectRatio="%s meet" viewBox="0 0 %d %d"%s>`,
fitToScreenWrapperOpening = fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" data-d2-version="%s" preserveAspectRatio="%s meet" viewBox="0 0 %d %d"%s>`,
version.Version,
alignment,
w, h,