-
-
Notifications
You must be signed in to change notification settings - Fork 274
Description
I'm using Kroki through asciidoctor with asciidoctor-kroki plugin.
I have a problem with Wavedrom diagrams using the assign diagram type. The generated SVG content is not correct. There is no problem with signal diagrams type.
You can reproduce the problem using the Kroki main page Try section.
Enter the following code:
{ signal: [
{ name: "clk", wave: "p.....|..." },
{ name: "Data", wave: "x.345x|=.x", data: ["head", "body", "tail", "data"] },
{ name: "Request", wave: "0.1..0|1.0" },
{},
{ name: "Acknowledge", wave: "1.....|01." }
]}
You get this :
Click on the copy link button just under the diagram and copy the link in a browser tab. You get this :
Perfect.
Repeat with the following code:
{ assign:[
["out",
["|",
["&", ["~", "a"], "b"],
["&", ["~", "b"], "a"]
]
]
]}
You get this:
Copy and paste the link in a new browser tab. You get this :
Not good.
Looking at the svg content, the first example generates <svg id="svgcontent_0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="150" width="540" viewBox="0 0 540 150" overflow="hidden" class="WaveDrom">...
While the second example generates <svg id="svgcontent_0" viewBox="0 0 225 81" width="225" height="81" class="WaveDrom">...
Manually adding xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" to the second example generated svg content makes the browser display the svg image correctly.
I tried the Wavedrom generator on the Wavedrom website. There is no such issue. So it seems the problem comes from Kroki.
Using:
Windows 11
Firefox 144