Closed ryepup closed 3 years ago
jekyll-spaceship
make a markdown page like this:
graph TD a[jekyll-spaceship] click a "https://github.com/jeffreytse/jekyll-spaceship" "view on github"
jekyll build
Clicking the "jekyll-spaceship" node in the rendered graph navigates to https://github.com/jeffreytse/jekyll-spaceship
Nothing
mermaid-processor.rb gets the SVG from mermaid and renders it in an <img> tag. That tag does not support interactivity.
mermaid-processor.rb
<img>
If we render it with an <object> tag, then the interactive elements in SVG work.
<object>
I think the relevant spot to change is here: https://github.com/jeffreytse/jekyll-spaceship/blob/7d86dcbe03aabbde70d4b30d5d5b483754672632/lib/jekyll-spaceship/processors/mermaid-processor.rb#L76
looks like <object> won't work; I can click the link but it tries to navigate inside the <object> body, which isn't right
fixed with e1a5bf7 and using mode: 'pre-fetch'
mode: 'pre-fetch'
Repro
jekyll-spaceship
make a markdown page like this:
title: mermaid demo
jekyll build
Expected behavior
Clicking the "jekyll-spaceship" node in the rendered graph navigates to https://github.com/jeffreytse/jekyll-spaceship
Actual behavior
Nothing
Analysis
mermaid-processor.rb
gets the SVG from mermaid and renders it in an<img>
tag. That tag does not support interactivity.If we render it with an
<object>
tag, then the interactive elements in SVG work.I think the relevant spot to change is here: https://github.com/jeffreytse/jekyll-spaceship/blob/7d86dcbe03aabbde70d4b30d5d5b483754672632/lib/jekyll-spaceship/processors/mermaid-processor.rb#L76