is there a way to create html without starting it ...
# kotlinx-html
a
is there a way to create html without starting it off a
<html>
tag? I want to be able to output html like
<div></div>
but it seems like i am forced to create it like
<html><div></div></html
workaround:
Copy code
typealias Html = FlowContent

fun writeHtml(builderAction: Html.() -> Unit): String {
    return createHTML(prettyPrint = false)
        .apply { div { builderAction() } }
        .finalize()
        .removePrefix("<div>")
        .removeSuffix("</div>")
}
t
This question has popped up before. There are some interesting implementations if you start reading from this post: https://kotlinlang.slack.com/archives/CKWA2MV8U/p1728981104075979
👍 1