asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

Clickable links inside plantuml don't work in preview panel

Open osisaelias opened this issue 3 years ago • 2 comments

Description

When I include links in a plantuml, they render correctly in the preview panel as underlined blue text. However they are not clickable. I use the SVG format since plantuml only supports SVG, PNG, and TXT. The links work when exporting the SVG file (with kroki-fetch-diagram) and opening them in an external program. When setting opts=interactive, the preview only shows "Diagram" (w/o quotes) as plain text and the diagram is not rendered at all. This only happens when the format is SVG. In PNG, the diagram renders but since PNG doesn't support links, this is of no use.

System Information

VSCodium 1.70.0 Asciidoctor Extension 3.0.0 Windows 11

To Reproduce

[plantuml, format=svg, opts=interactive]
....
@startuml
actor Dan
actor Marc
Dan -> Marc : [[https://google.com hi mark]]
@enduml
....

osisaelias avatar Aug 10 '22 08:08 osisaelias

I can confirm, exactly the same behaviour in my documents.

ardanedh avatar Aug 30 '23 13:08 ardanedh

Underlying error is:

Unsafe attempt to initiate navigation for frame with origin 'vscode-file://vscode-app' from frame with URL 'https://kroki.io/plantuml/svg/eNpLTC7JL1JwSczjSgSzfBOLkrmAXAVdOzBbwUohOjqjpKSg2EpfPz0_Pz0nVS85P1chI1MhN7EoOzaWCwDXkRXD'.
The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.

It seems to be a new restriction/security by Chromium: https://html.spec.whatwg.org/multipage/browsers.html#sandboxed-top-level-navigation-with-user-activation-browsing-context-flag

Please open an issue upstream at https://github.com/microsoft/vscode since I don't know how to workaround this limitation.

ggrossetie avatar Feb 11 '24 14:02 ggrossetie