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

Plantuml diagram links are blank #1105

Closed
gregLibert opened this issue Jun 18, 2019 · 4 comments
Closed

Plantuml diagram links are blank #1105

gregLibert opened this issue Jun 18, 2019 · 4 comments
Assignees
Milestone

Comments

@gregLibert
Copy link

Hi,
I've got an issue when generating plantuml diagram with html links: they are all blanks as show in the picture above.

asciidoctor-pdf_blank

It's working with html generation as show in the picture above:

asciidoctor-pdf_normal

The following attributes are used for plantuml block definition:

[plantuml, debit_then_credit, svg, opts=interactive]

Furthermore, I'm using the following version/environment:

asciidoctor-pdf --version
Asciidoctor PDF 1.5.0.alpha.18 using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
@mojavelinux
Copy link
Member

Please provide the diagram source so I can test.

What I can tell you right away is that prawn-svg does not support HTML embedded in the SVG. If there's a link, it must be defined using a xlink:href.

A browser doesn't have this restriction because it can understand arbitrary HTML in an SVG because it's an HTML environment. In other words, the browser is not really rendering an SVG so much as enhanced HTML.

@gregLibert
Copy link
Author

Thank you for your answer.
Here is a code sample directly copied from plantuml sample:

[plantuml, test_link, svg, opts=interactive]
----
actor Bob [[http://plantuml.com/sequence]]
actor "This is [[http://plantuml.com/sequence Alice]] actor" as Alice
Bob -> Alice [[http://plantuml.com/start]] : hello
note left [[http://plantuml.com/start]]
  a note with a link
end note
Alice -> Bob : hello with [[http://plantuml.com/start{Tooltip for message} some link]]
note right [[http://plantuml.com/start]] : another note
note left of Bob
You can use [[http://plantuml.com/start links in notes]] also.
end note
----

Do you have any idea of how I could include xlink:href in svg diagram through plantuml ?

@mojavelinux
Copy link
Member

plantuml is putting an <a> tag around the text (which happens to use the xlink:href attribute). It looks the fact that this results in blank text is a bug / shortcoming in prawn-svg. I could manipulate the SVG data to strip the enclosing <a> tag, but it think it would be better to see if prawn-svg would be willing to address this.

I've filed an issue in prawn-svg to discuss. See mogest/prawn-svg#111

@mojavelinux
Copy link
Member

This has been implemented upstream. We're now just waiting on a release.

@mojavelinux mojavelinux self-assigned this Nov 14, 2019
@mojavelinux mojavelinux added this to the v1.5.0 milestone Nov 14, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 14, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 14, 2019
@mojavelinux mojavelinux modified the milestones: v1.5.0, v1.5.0.beta.8 Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants