stringfilter
Decorator for filters which should only receive strings. The object passed as the first positional argument will be converted to a string.
def stringfilter(
func: callable
) - > function
Decorator for filters which should only receive strings. The object passed as the first positional argument will be converted to a string.
Parameters
| Name | Type | Description |
|---|---|---|
| func | callable | The filter function to be decorated, which expects a string as its first argument. |
Returns
| Type | Description |
|---|---|
function | A wrapped version of the original filter function that ensures the first argument is cast to a string and preserves HTML safety markers if applicable. |