asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
439 stars 107 forks source link

`data-uri` attribute fails for asciidoctor-diagram diagrams #435

Closed ManDay closed 1 year ago

ManDay commented 1 year ago

data-uri seems to be ignored in asciidoctor 2.0.18 (tried with [gnuplot,format=svg]) for asciidoctor-diagram 2.0.5 generated images, while it works for other images of the image: type, both SVG and JPG.

pepijnve commented 1 year ago

I'll look into it asap.

pepijnve commented 1 year ago

data-uri is handled by the html5 backend; not by this extension. See https://github.com/asciidoctor/asciidoctor/blob/main/lib/asciidoctor/abstract_node.rb#L323 for the details. It only kicks in when the configured safe mode is less than SECURE. Could you check which safety mode you're using?

ManDay commented 1 year ago

I am using asciidoctor on CLI as

asciidoctor -a data-uri -r asciidoctor-diagram -o /tmp/script/index.html source.adoc

so I assume that makes it UNSAFE? Should I verify this somehow?

ManDay commented 1 year ago

Maybe I made a mistake (perhaps I judged from the presence of the SVG files in the directory). I made another test and now I have a data-uri. I will verify this with my original document instantly and report back. Sorry for that!

ManDay commented 1 year ago

Please accept my apologies for this, it turns out it was my mistake and data-uri does work. I must have mixed something up and come to the wrong conclusions!