https://kotlinlang.org logo
Title
ł

Łukasz Kłosiński

11/18/2021, 8:54 PM
I am trying to send the generated Template<FlowContent> as a text response (I do not want to send the full HtmlTemplate). So far I have got below:
fun Route.test() {
    get("/test") {
        call.respondText(
            buildString {
                appendHTML().div {
                    insert(TestTemplate(), TemplatePlaceholder())
                }
            }
        )
    }
}
To make it work I have to wrap my TestTemplate in another div.
<div>
  <div>this is the element I want to get, without the outer element</div>
</div>
Is there a way of doing it so I can send the actual template only, so I can get below:
<div>this is the element I want to get, without the outer element</div>