striptags
¶
The striptags
filter strips SGML/XML tags and replace adjacent whitespace
by one space:
striptags フィルターは、SGML/XML タグを取り除き、隣接する空白を 1 つのスペースに置き換えます。
1 |
{{ some_html|striptags }}
|
You can also provide tags which should not be stripped:
削除してはならないタグを指定することもできます:
1 |
{{ some_html|striptags('<br><p>') }}
|
In this example, the <br/>
, <br>
, <p>
, and </p>
tags won't be
removed from the string.
この例では、、、、およびタグは文字列から削除されません。
Arguments ¶
allowable_tags
: Tags which should not be strippedallowable_tags: 剥がしてはいけないタグ