Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG not rendering correct #143

Closed
SilentButeo2 opened this issue Oct 19, 2021 · 3 comments
Closed

SVG not rendering correct #143

SilentButeo2 opened this issue Oct 19, 2021 · 3 comments

Comments

@SilentButeo2
Copy link

I'm using asciidoctor-pdf (1.60 on Win10) to convert .adoc files.
I have some issues to see some of the [mermaid] converted images.
In my setup, the [mermaid] text gets converted into a .svg file. And I presume it is that .svg that is send to prawn-svg to get converted.

This is the result I expect:
svg

And this is the result in the PDF file:
pdf

Attached the .svg file

And the actual .adoc code:

[mermaid]
....
flowchart TD
    prawn-svg
....

Could be related to asciidoctor/asciidoctor-pdf#430 and #79

@mogest
Copy link
Owner

mogest commented Oct 19, 2021

Hi @SilentButeo2, can you please confirm it's a prawn-svg problem by running the svg directly through prawn-svg (see README file for three lines of how to do that), check the svg is only using v1.1 elements and that they're supported (there's a list in the README of supported and unsupported elements.) Happy to help if there's still a problem, let me know!

@mojavelinux
Copy link
Contributor

The problem here is one that has come up many, many times. Mermaid does not generate portable SVGs. Instead, it embeds HTML into the SVG container as a foreign object. That is only going to work in a web browser. In order for an SVG library like prawn-svg to render an image, it needs to be a pure SVG.

@mogest
Copy link
Owner

mogest commented Oct 19, 2021

Ah, thanks again @mojavelinux!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants