How can I find all referenced images in an asciidoc file with Asciidoctor API?
I can find block images `image::file_name[]` with `find_by(context: :image)` however I can't find inline images.
I'm attaching a test code
a.rb I came up with.
require 'asciidoctor'
input = <<-EOS
= Title
== Chapter 1
image::foo.png[]
=== Section 1.1
image::bar.png[]
This is a paragraph with inline image image:baz.png[].
EOS
doc = Asciidoctor.load input
doc.find_by(context: :image).each do |e|
pp e.attributes["target"]
end
Running the code yields:
"foo.png"
"bar.png"
But the last inline `image:baz.png[]` is not found. What / where can I change to find baz.png?