EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...
    • 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)

      • lang: string

        Publishing locale

      • surface: SeoSurface

        Target SEO surface

      Returns string

      Clamped text ≤ budgetFor(lang, surface) characters