https://kotlinlang.org logo
#compose-web
Title
# compose-web
r

Renaud

01/27/2023, 8:36 PM
Another question related to the Markdown Library. Do you know if there is a component (or element?) where you can pass a HTML STRING and its directly maps to elements? For example, based on the README.md :
Copy code
val src = "Some *Markdown*"
val flavour = CommonMarkFlavourDescriptor()
val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(src)
val html = HtmlGenerator(src, parsedTree, flavour).generateHtml() 

Text(html)
will render :
Copy code
<body><p>Some <em>Markdown</em></p></body>
Like a way the component understand <em> is:
Copy code
private val Em: ElementBuilder<HTMLElement> = ElementBuilderImplementation("em")
4 Views