Truncate

truncateMicronode

Shortens text to a maximum length, ending it with an ellipsis. Folded at compile time: the result is spliced into the surrounding text as characters, so no node reaches the renderer and the number cannot be re-formatted, animated or bound to afterwards. Length counts Unicode scalar values, and the ellipsis counts inside it.

Explained in:Value primitives

#Attributes

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

#Allowed content

Body { }Text

#Examples

!truncate:8{internationalisation}

#Notes

  • !truncate:8{internationalisation} folds to interna…; text already within the length is unchanged.
  • A length that leaves no room for the ellipsis is a compile error.