Merge pull request #582 from alixander/dont-add-appendix-seperator

don't add appendix seperator without appendix
This commit is contained in:
Alexander Wang 2022-12-31 12:20:41 -08:00 committed by GitHub
commit dbc09d1175
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -3,3 +3,5 @@
#### Improvements 🧹 #### Improvements 🧹
#### Bugfixes ⛑️ #### Bugfixes ⛑️
- Appendix seperator line no longer added to PNG export when appendix doesn't exist. [#582](https://github.com/terrastruct/d2/pull/582)

View file

@ -153,6 +153,9 @@ func generateAppendix(diagram *d2target.Diagram, ruler *textmeasure.Ruler, svg s
} }
} }
} }
if len(lines) == 0 {
return "", 0, 0
}
totalHeight += SPACER totalHeight += SPACER
return fmt.Sprintf(`<g x="%d" y="%d" width="%d" height="100%%">%s</g> return fmt.Sprintf(`<g x="%d" y="%d" width="%d" height="100%%">%s</g>