|attribut_html

The |attribut_html filter applied to a text tag will translate its html rendering into a format that can be used without damage in an html attribute (alt="...", title="...", value="...").

  • New in : SPIP 1.4

For example, from a #DESCRIPTIF tag which normally returns the following html source: 2 is "greater" than 1 & it's noted: 2 > 1, to fill in the alt attribute of an image we’ll use :

<img alt="[(#DESCRIPTIF|attribut_html)]"

that will return the html source:
<img alt="2 est &quot;greater&quot; than 1 &#38; c&#39;it's noted: 2 &gt; 1"...

Note that this filter removes html tags:

<strong>Hello</strong> Summer !

becoming:
Hello Summer !

See also

Author Mark Published : Updated : 16/07/24

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