Markdown/HTML injection #880
-
I'd like to display some Markdown in a component; kinda like the window I'm looking at right now. Suppose I convert that to plain HTML first. Should I use |
Beta Was this translation helpful? Give feedback.
Answered by
Archmonger
Jan 15, 2023
Replies: 2 comments
-
You can use markdown with the following steps:
import markdown
from idom.utils import html_to_vdom
from idom import component, run, html
example_md = "### Hello World"
example_html = markdown.markdown(example_md)
example_vdom = html_to_vdom(example_html)
@component
def example_component():
return html.div(example_vdom)
run(example_component) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
numpde
-
Thank you, that's the one. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use markdown with the following steps:
idom.utils.html_to_vdom
to convert it to VDOM