Skip to main content

truncatechars_html

Truncate HTML after arg number of chars. Preserve newlines in the HTML.

def truncatechars_html(
value: string,
arg: integer
) - > string

Truncate HTML after arg number of chars. Preserve newlines in the HTML.

Parameters

NameTypeDescription
valuestringThe HTML content or string to be truncated.
argintegerThe maximum number of characters to display before truncation occurs.

Returns

TypeDescription
stringThe truncated HTML string with tags properly closed and newlines preserved, or the original value if the argument is invalid.