Truncate text to fit (lang, surface) SEO byte budget. Prefers a
natural clause boundary inside the script's punctuation vocabulary
(CJK / RTL / Latin) before falling back to a whitespace break.
Always returns text verbatim when it already fits (no ellipsis
appended). When truncation happens an ellipsis (…) is appended for
Latin / RTL; for CJK the full-width ellipsis (…) reads as a
partial-thought marker and is also appended — Schema.org and Google
accept either glyph in headline / description.
Parameters
text: string
Source text (already plain-text — no Markdown / HTML)
Truncate
textto fit(lang, surface)SEO byte budget. Prefers a natural clause boundary inside the script's punctuation vocabulary (CJK / RTL / Latin) before falling back to a whitespace break.Always returns
textverbatim when it already fits (no ellipsis appended). When truncation happens an ellipsis (…) is appended for Latin / RTL; for CJK the full-width ellipsis (…) reads as a partial-thought marker and is also appended — Schema.org and Google accept either glyph inheadline/description.