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

SVG string may not include any newlines a/o spaces #32

Open
hgiesel opened this issue Mar 5, 2021 · 0 comments
Open

SVG string may not include any newlines a/o spaces #32

hgiesel opened this issue Mar 5, 2021 · 0 comments

Comments

@hgiesel
Copy link

hgiesel commented Mar 5, 2021

I'm using remark-admonitions in the context of Docusaurus v2. I tried to define my admonition like so:

customTypes: {
    kk: {
      keyword: "kk",
      emoji: "❗️",
      svg: `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
...svg xml...
</svg>
`,
    },
},

Which I expected to work. However it gave me the following error:

TypeError: Cannot read property 'map' of undefined
at Array.map ()
at new Promise ()

What I had to do, was remove all newlines and extra spaces in the svg string:

customTypes: {
    kk: {
      keyword: "kk",
      emoji: "❗️",
      svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">...svg xml...</svg>
`,
    },
},

Then it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant