The |entites_html filter is applied to a text tag and will translate the HTML rendition of that tag by transforming into HTML entities any constituent characters that do not belong to the page’s charset, as well as any ", < and >.
This is used to insert the text of a tag into a <textarea> </textarea> without causing any problems.

For example, if we start with a #DESCRIPTIF tag which returns the following HTML source: 2 is "greater" than 1 & is written as: 2 > 1,


would return the following HTML source: <textarea>2 is &quot;greater&quot; than 1 &amp; is written as: 2 &gt; 1</textarea>

Author Mark Published : Updated : 26/10/12

Translations : català, English, Español, français, Nederlands