Question

In play framework we use @Html in scala views if we do not want play to escape Html characters. Is there any alternate to this in Japid. I tried to import play.api.templates.Html and tried ${Html and ${Html.get but they are not working. Am I doing something wrong.

Was it helpful?

Solution

Japid by default does not escape the string value of expressions to make it html safe, like what Play! does.

Reference: https://github.com/branaway/Japid/blob/master/documentation/manual/Japid_Generic_Engine.textile

In case you need to explicitly escape the string value of expression, you can use:

${escapeHtml(expr)}

OTHER TIPS

Or simply:

~{expr}

~ means escape.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top