streaming/inline_hold library

Holding the reveal behind markup that has not finished arriving.

A streaming reply is parsed from what has been received so far, so an inline construct is literal text until its closing delimiter lands. `npm is prose; `npm install` is a code chip. Reveal the characters as they arrive and the reader watches eight settled words turn monospace a moment later — a different font, a background, different metrics, and a line that reflows around them. The same happens when **bold closes, or \(x^2.

Nothing is wrong with the parse; the reveal is simply ahead of it. So the head waits: characters that could still change meaning are not shown until the construct that governs them is complete, and every character a reader sees is already in its final form.

Constants

markupDelimiterHold → const int
Longest run of text the reveal will wait on for a delimiter that is unambiguously markup.
proseDelimiterHold → const int
Longest run of text the reveal will wait on for a delimiter that also occurs in ordinary prose.

Functions

inlineSafeLength(String source, {bool holdMathDollars = false}) int
How much of source can be shown without its styling changing later.