mark_safe
Explicitly mark a string as safe for (HTML) output purposes. The returned object can be used everywhere a string is appropriate.
If used on a method as a decorator, mark the returned data as safe.
Can be called multiple times on a single string.
def mark_safe(
s: Any
) - > SafeString
Explicitly mark a string as safe for (HTML) output purposes. The returned object can be used everywhere a string is appropriate.
Parameters
| Name | Type | Description |
|---|---|---|
| s | Any | The string, lazy object, or callable to be marked as safe for HTML output. |
Returns
| Type | Description |
|---|---|
SafeString | A string-like object that is flagged as safe for HTML rendering, preventing further auto-escaping. |