Utils
- TagScriptEngine.utils.truncate(text: str, *, max: int = 2000, var: str = '...') str[source]
Truncate the given string to avoid hitting the character limit.
- Parameters:
text – The string to be truncated.
max – On what character length the string should be truncated.
var – The custom string used for trunication (defaults to ‘…’).
- Returns:
str – The truncated content.
.. versionadded:: 3.2.0