Skip to content

Commit

Permalink
preview no longer increments figure numbers by two instead of one (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahus1 committed Aug 11, 2019
1 parent 4891749 commit 7b2526b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This document provides a high-level view of the changes introduced by release.
[[releasenotes]]
== Release notes

=== 0.29.4 (preview, available from Github releases)

- preview no longer increments figure numbers by two instead of one (#317)

=== 0.29.3 (preview, available from Github releases)

- support syntax highlighting within definition list (#307)
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plantuml-png-patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def process(parent, reader_or_target, attributes)
# render as SVG to be used for save-as functionality
attributes['format'] = 'svg'
super(parent, reader_or_target, attributes)
# rewind figure-number for second call, otherwise it will be incremented twice
fignum = parent.document.attr('figure-number')
parent.document.set_attr('figure-number', fignum - 1)
# render a second time for PNG to be used in preview
attributes['format'] = 'png'
super(parent, reader_or_target, attributes)
Expand Down

0 comments on commit 7b2526b

Please sign in to comment.