Skip to content

Commit

Permalink
Merge pull request #582 from alixander/dont-add-appendix-seperator
Browse files Browse the repository at this point in the history
don't add appendix seperator without appendix
  • Loading branch information
alixander authored Dec 31, 2022
2 parents ae94c14 + 2b2c912 commit dbc09d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ci/release/changelogs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
#### Improvements 🧹

#### Bugfixes ⛑️

- Appendix seperator line no longer added to PNG export when appendix doesn't exist. [#582](https://github.com/terrastruct/d2/pull/582)
3 changes: 3 additions & 0 deletions d2renderers/d2svg/appendix/appendix.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func generateAppendix(diagram *d2target.Diagram, ruler *textmeasure.Ruler, svg s
}
}
}
if len(lines) == 0 {
return "", 0, 0
}
totalHeight += SPACER

return fmt.Sprintf(`<g x="%d" y="%d" width="%d" height="100%%">%s</g>
Expand Down

0 comments on commit dbc09d1

Please sign in to comment.