Skip to content

Commit

Permalink
#416 Don't eagerly convert Inline nodes during processing
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnve committed Jun 12, 2023
1 parent 0a52fe3 commit 372a3f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
= Asciidoctor-diagram Changelog

== 2.2.10

Bugfixes::

* Issue #416: Silence Asciidoctor warning when using inline macros

== 2.2.9

Bugfixes::
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor-diagram/diagram_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def process(parent, reader_or_target, attributes)
block = generate_block(parent, reader_or_target, attributes)
attrs = block.attributes.dup
target = attrs.delete('target')
create_inline(parent, :image, nil, :type => 'image', :target => target, :attributes => attrs).convert
create_inline(parent, :image, nil, :type => 'image', :target => target, :attributes => attrs)
end

def supported_formats(converter)
Expand Down
5 changes: 4 additions & 1 deletion spec/test_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def find(&block)
module Asciidoctor
module Diagram
module TestHelpers
include ::Asciidoctor::Logging

def load_asciidoc(source, options = {})
options = options.dup
options[:trace] = true
Expand All @@ -71,7 +73,8 @@ def load_asciidoc(source, options = {})
options[:attributes]['diagram-on-error'] = 'abort'
end

::Asciidoctor.load(StringIO.new(source), options.merge({:trace => true}))
logger.level = ::Logger::Severity::DEBUG
::Asciidoctor.load(StringIO.new(source), options.merge({:trace => true, :verbose => 2}))
end
end
end
Expand Down

0 comments on commit 372a3f9

Please sign in to comment.