Closed edl7878 closed 3 years ago
I can reproduce this locally, but I don't think there's much I can do about this. The positional attributes are actually not mapped the way you think they are. As far as I can tell the parsing of attribute lists will not allow you to skip positional attributes. What the extension actually receives is
1 => "plantuml"
2 => "svg"
while you're expecting it to receive
1 => "plantuml"
2 => nil
3 => "svg"
The consequence is that asciidoctor-diagram is receiving svg
as target value twice and the target of the block is used to derive the output filename.
The simplest workaround for this is to use format="svg"
instead or set the format at the document level using :plantuml-format: svg
.
@mojavelinux is there a difference between asciidoctor and asciidoctor.js in how it parses an attribute list like [plantuml,,svg]
when it comes to handling the middle empty attribute?
@pepijnve Got it. Thanks.
@pepijnve Not to my knowledge. It's the same code. The variation probably comes from the kroki extension itself.
This actually looks like a parsing bug. The parser allows the first position to be blank (e.g., ,ruby
), but not any other position. It should retain the positional offset so it's consistent with the number of delimiters. Please file an issue in core.
Thanks for logging this @mojavelinux. @edl7878 once the asciidoctor issue has been resolved the workaround(s) I mentioned will no longer be necessary.
the upper asciidoctor code will output the same image which is the last diagram when use asciidoctor binary as render, while privewing with asciidoctor.js and kroki, the diagrams outputted individually.
evinonment: hugo + asciidoctor binary + asciidoctor-diagram