Issue
I am using Kotlin's html library kotlinx.html
for dynamic html building.
For debugging proposes I want to write a tag as a raw html. But I can't find any method that would do it. Simple text addition replaces characters like <
to their codes, so it does not help:
StringBuilder().appendHTML().html {
body {
+"""
<form action="http://courier-voddan.rhcloud.com/customer/new_task" method="get">
get=form
id=3333
<button type="submit">ok</button>
</form>
""".trimIndent()
}
}
Solution
Simply use unsafe
inside your tag to prevent HTML encoding.
body {
unsafe {
+"""<form class="formClass"/>"""
}
}
Answered By - Mathias Parger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.