Return the given text with ampersands, quotes and angle brackets encoded for use in HTML. Always escape input, even if it's already escaped and marked as such. This may result in double-escaping. If this is a concern, use conditional_escape() instead.
(text)
| 51 | |
| 52 | @keep_lazy(SafeString) |
| 53 | def escape(text): |
| 54 | class="st">""" |
| 55 | Return the given text with ampersands, quotes and angle brackets encoded |
| 56 | for use in HTML. |
| 57 | |
| 58 | Always escape input, even if it&class="cm">#x27;s already escaped and marked as such. |
| 59 | This may result in double-escaping. If this is a concern, use |
| 60 | conditional_escape() instead. |
| 61 | class="st">""" |
| 62 | return SafeString(html.escape(str(text))) |
| 63 | |
| 64 | |
| 65 | _js_escapes = { |