How to render dynamic html

I would suggest rethinking the design. Static templates perform better, are safer, and easier to maintain and test. If you need to render a domain language, see this post.