Skip to content

Commit

Permalink
reset attribute to previous value as counter is only incremented when…
Browse files Browse the repository at this point in the history
… there is a title (#317)
  • Loading branch information
ahus1 committed Aug 11, 2019
1 parent 7b2526b commit a845413
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
= IntelliJ AsciiDoc Plugin
Alexander Schwartz
:experimental:
:url-ci-travis: https://travis-ci.org/asciidoctor/asciidoctor-intellij-plugin

image::https://api.travis-ci.org/asciidoctor/asciidoctor-intellij-plugin.svg?branch=master[link={url-ci-travis}]

A plugin for the IntelliJ platform (IntelliJ IDEA, RubyMine, etc) that provides support for the http://www.asciidoc.org[AsciiDoc] markup language.
To support the authors of Asciidoctor, please consider supporting us via https://opencollective.com/asciidoctor[OpenCollective].
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/plantuml-png-patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module SvgToPngHack
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
# rewind figure-number for second call (note that it will only be incremented if the diagram has a title)
fignum = parent.document.attr('figure-number')
parent.document.set_attr('figure-number', fignum - 1)
super(parent, reader_or_target, attributes)
parent.document.set_attr('figure-number', fignum)
# 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 a845413

Please sign in to comment.