Skip to content

rife.render.EncodeHtmlEntities

Erik C. Thauvin edited this page Mar 28, 2023 · 2 revisions

Encodes a template value to HTML decimal entities.

Usage

<!--v render:rife.render.EncodeHtmlEntities:valueId/-->
{{v render:rife.render.EncodeHtmlEntities:valueId/}}

Sample

Template

<a href="mailto:{{v render:rife.render.EncodeHtmlEntities:email/}}">Email</a>

Code

template.setAttribute("email", "john@doe.com");

Output

<a href="mailto:&#106;&#111;&#104;&#110;&#64;&#100;&#111;&#101;&#46;&#99;&#111;&#109;">Email</a>