[formatter] implement 'H' conversion (#4164)
to remove HTML tags and unescape HTML entities
This commit is contained in:
@@ -94,6 +94,18 @@ Conversion specifiers allow to *convert* the value to a different form or type.
|
||||
<td><code>{created!d}</code></td>
|
||||
<td><code>2010-01-01 00:00:00</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><code>U</code></td>
|
||||
<td>Convert HTML entities</td>
|
||||
<td><code>{html!U}</code></td>
|
||||
<td><code><p>foo & bar</p></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><code>H</code></td>
|
||||
<td>Convert HTML entities & remove HTML tags</td>
|
||||
<td><code>{html!H}</code></td>
|
||||
<td><code>foo & bar</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><code>s</code></td>
|
||||
<td>Convert value to <a href="https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str" rel="nofollow"><code>str</code></a></td>
|
||||
|
||||
Reference in New Issue
Block a user