EU Parliament Monitor โ€” API Documentation - v0.9.24
    Preparing search index...
    • Clamp a title to TITLE_MAX_LENGTH characters in the same word-boundary-preserving fashion as truncateDescription.

      No mid-sentence ellipsis. When the title overruns the budget and no natural clause boundary exists inside the [HEADLINE_SOFT_MIN, TITLE_MAX_LENGTH] window, this function returns an empty string instead of a mid-sentence โ€ฆ truncation. The empty return tells the caller to fall through to the next tier of the resolver ladder (template-fallback title with category + date), producing a complete, scan-friendly title rather than a clipped editorial fragment. Live-site regression (2026-05): titles such as AI Trade Strategy: A Legislative First with Structuralโ€ฆ and The European Parliament's 24 standing committees continuedโ€ฆ were emitted before this guard.

      Parameters

      • text: string

        Raw title text

      Returns string

      Clause-truncated title (no ellipsis), or '' when no editorial clause boundary exists in the window