asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
322 stars 97 forks source link

Clickable links inside plantuml don't work in preview panel #617

Open osisaelias opened 1 year ago

osisaelias commented 1 year ago

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
....
ardanedh commented 10 months ago

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

ggrossetie commented 4 months ago

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.