-
I'm trying to dynamically create markdown tables in my script and then display them in the markdown. I have my variable which contains a valid markdown table but when putting To make the example more simple, i have a variable defined like so: const markdownContent = '# Test' I want this rendered like Headingbut it is instead being rendered as So I'm basically wondering if there is a way to tell VitePress to render a variable as markdown content. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Markdown processing is static at build time, so there is no way to render them as Vue variables (which needs to work at both build time and runtime). Even if it works, you shouldn't be using The idiomatic way to do this is directly render the table HTML using |
Beta Was this translation helpful? Give feedback.
Markdown processing is static at build time, so there is no way to render them as Vue variables (which needs to work at both build time and runtime).
Even if it works, you shouldn't be using
{{ }}
to render them because it renders the content as plain text instead of HTML by design.The idiomatic way to do this is directly render the table HTML using
v-for
on your data, just like you'd do in Vue templates, instead of concatenating markdown.