In the kotlinx.html documentation, it talks building "widgets" (where a widget is just some of the html dsl) like this:
@HtmlTagMarker
fun FlowContent.widget(body: FlowContent.() -> Unit) {
div { body() }
}
How would you turn that into html if you didn't want to wrap it in a body? It's clear how you would get it wrapped in something else:
createHTML().body {
widget { +"stuff" }
}
gets you
<body>
<div>stuff</div>
</body>
But what's the right way to just get the <div>stuff</div>
without wrapping it in something?
According to (not-so-easy-to-discover) official documentation:
So to make your example work you need:
And using it will give you expected result: