truncate

truncateMicronode

Shortens text to a maximum length, ending it with an ellipsis. Length counts Unicode scalar values, and the ellipsis counts inside it, so the result is never longer than asked.

Explained in:Functions

#Attributes

lengthRequiredImplicit
Maximum length of the result, ellipsis included.Can be written as shorthand: truncate:value
ellipsis
What marks the cut.
Default

#Allowed content

Body { }Inline Chalk content, flattened to plain text

#Examples

!truncate:8{internationalisation}

#Notes

  • !truncate:8{internationalisation} gives interna…; text already within the length is unchanged.
  • A length with no room for the ellipsis drops the ellipsis rather than overflowing the length.