Text filters

This table summarises the filters that modify the rendering of tags that produce text in HTML format, what they do, and when to use them.

Text filters
Filtre Effect & utility Input text / output text
textebrut Replaces <p>, <br /> and double line breaks with single line breaks; non-breaking spaces and double spaces with single spaces.
Uses to insert text into <meta> tags, and other HTML tags.
<p>William Shakespeare :</p><p>born at Stratford-Upon-Avon</p>
William Shakespeare :
born at Stratford-Upon-Avon
texte_backend Formats text for XML feeds.
Particularly useful in RSS feed templates.
<p><strong>William Shakespeare</strong> was born at Stratford-Upon-Avon</p>
&lt;p&gt;&lt;strong&gt;William Shakespeare&lt;/strong&gt; was born at Stratford-Upon-Avon &lt;/p&gt;
attribut_html Formats text for HTML Attributes.
Typically used, in the attributes <title>, <alt>...
I'm not "talking" to you
I&apos;m not &quot;talking&quot; to you
texte_script Formats text for PHP and JS scripts.
Escape the quotes
SPIP, Système de publication pour l'internet
SPIP, Système de publication pour l\'internet
safehtml Escapes the PHP and JS code
To be used to secure texts coming from outside (forums, syndications...)
<script type="text/javascript">...</script>
<script type="text/javascript">...</script>
supprimer_tags Removes all HTML tags while keeping the content of these same tags.
Enables you to obtain a "raw" text.
<p><strong>William Shakespeare</strong> was born at <em>Stratford-Upon-Avon</em></p>
William Shakespeare was born at Stratford-Upon-Avon
charset2unicode Transforms to unicode entities &#129;.
The interest of this filter is that it does not impact html tags.
2 is > than 1
2 is &gt; than 1
echapper_tags Transforms the tag chevrons <...> into an HTML entity.
Useful for text between tags. <pre>.
<p><strong>William Shakespeare</strong> was born at Stratford-Upon-Avon</p>
&lt;p&gt;&lt;strong&gt;William Shakespeare&lt;/strong&gt; was born at Stratford-Upon-Avon&lt;/p&gt;
PtoBR Transforms paragraph breaks <p> into simple line breaks.
Allows you to "tighten" a layout.
<p><strong>William Shakespeare :</strong></p><p style="color:navy;">born at Stratford-Upon-Avon </p>
<strong>William Shakespeare :</strong><br />born at Stratford-Upon-Avon
liens_absolus Transforms all links (<a href=..., <link href:..., <img src=... and <script src=...) into absolute links.
Particularly useful in RSS feed skeletons.
<img src="IMG/arton01.jpg">
<img src="http://thesite.com/IMG/arton01.jpg">
liens_ouvrants Transforms SPIP links that lead to external sites to open in a new window or tab.
<a href="http://www.spip.net/page.html">
<a href="http://www.spip.net/page.html" target="_blank">

Note that the lignes_longues filter can still be used but is deprecated. It is preferable to cut long lines using CSS properties such as word-wrap.

lignes_longues Introduces caesura in the "too long" words..


See also the complete list of filters: SPIP Filters

Author jack Published : Updated : 23/07/23

Translations : English, français, Nederlands