casid / jte

Secure and speedy templates for Java and Kotlin.
https://jte.gg
Apache License 2.0
737 stars 54 forks source link

Pass dynamic HTML Content to template #331

Closed techniqs closed 5 months ago

techniqs commented 5 months ago

I would love to pass to the jte/kte files some html formatted string which comes from my db to make it more dynamic, is there anyway to do that? I tried to pass a string and obviously it renders the whole string instead of trying to html render it and seems like Content is only for sharing code between templates so Im kinda clueless.

Would appreciate any help :)

kelunik commented 5 months ago

Sure! You can output raw HTML using $unsafe{...} instead of ${...}.

techniqs commented 5 months ago

@kelunik ah damn looks like I overlooked that part, thanks!