MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / getTrailingTextRun

Function getTrailingTextRun

src/patch-streaming-html.ts:93–107  ·  view source on GitHub ↗

Literal characters currently being typed at the end of the track.

(track: string)

Source from the content-addressed store, hash-verified

91
92/** Literal characters currently being typed at the end of the track. */
93function getTrailingTextRun(track: string): string {
94 const lastGt = track.lastIndexOf(">");
95 if (lastGt === -1) {
96 if (/<[a-z!/]/i.test(track)) {
97 return "";
98 }
99 return track.trim();
100 }
101
102 const tail = track.slice(lastGt + 1);
103 if (!tail.trim() || /<[a-z!/]/i.test(tail)) {
104 return "";
105 }
106 return tail.trim();
107}
108
109/** Unclosed element tags at end of strip-only track */
110function getOpenTagStack(html: string): string[] {

Callers 1

shouldShowStreamingCaretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected