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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline svgs don't work in Obsidian #37

Open
hjonasson opened this issue Nov 20, 2023 · 0 comments
Open

Inline svgs don't work in Obsidian #37

hjonasson opened this issue Nov 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hjonasson
Copy link

hjonasson commented Nov 20, 2023

Hi,

Firstly, thanks for this amazing feature.

I am trying to render a Flowchart which will have syntax like this one (I know GitHub has Mermaid support but this seems broken for them as well 馃し )

flowchart TD
    subgraph AWS Icons
        linkStyle default interpolate basis
        AWS5((<svg viewBox="0 0 16 16" width="50" height="50" xmlns="http://www.w3.org/2000/svg" fill="green"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path fill="#FFFFFF" fill-rule="evenodd" d="M14.495 10.057l-1.958-1.52v-2.83a.495.495 0 00-.238-.422L9.496 3.568V1.384l5 2.927v5.746zm.759-6.457L9.25.085a.51.51 0 00-.506-.004.496.496 0 00-.253.431v3.332c0 .172.09.332.237.422l2.804 1.717v2.795c0 .152.071.296.193.39l2.962 2.303a.502.502 0 00.53.055.496.496 0 00.283-.446V4.028a.493.493 0 00-.246-.428zM8.034 14.96l-6.53-3.289V4.31L6.488 1.37v2.185L3.747 5.27a.497.497 0 00-.232.42v4.567c0 .188.107.36.279.445l3.962 1.94c.141.07.309.068.45-.002l3.11-1.565 2.09 1.74-5.371 2.144zm3.675-4.855a.51.51 0 00-.552-.063l-3.182 1.6L4.52 9.95V5.963l2.738-1.715a.496.496 0 00.234-.42V.498a.502.502 0 00-.76-.426L.745 3.6a.496.496 0 00-.245.428v7.946c0 .187.106.358.274.442l7.008 3.53a.504.504 0 00.416.018l6.358-2.536a.496.496 0 00.136-.841l-2.983-2.483z" clip-rule="evenodd"></path></g></svg>))
    end

The issue is that when including <svg ... style svgs in Obsidian I get an error
image

It renders in the mermaid-to-excalidraw playground

image

but with an error output

Note that this is what it looks like from the MermaidJS playground

I am not sure where to start looking to fix it myself but Parse error on line N seems to be a MermaidJS error.

@ad1992 ad1992 added the bug Something isn't working label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants