Skip to content

Function: stripIncompleteMarkerTail()

stripIncompleteMarkerTail(text): string

Strip a trailing partial marker ([chart, [data:01f1, …) that hasn’t received its closing ] yet. While the model streams text-deltas a marker arrives across several chunks, and rendering each interim state would briefly flash the literal [chart:abc- prefix before the closing bracket swaps it for a slot. Hiding any trailing [<non-whitespace-non-bracket>... suffix keeps the prose stable until either a ] (full marker) or whitespace (definitely not a marker) lands. Persisted transcripts never end mid-marker, so this is a no-op on reload.

string

string