Literal characters currently being typed at the end of the track.
(track: string)
| 91 | |
| 92 | /** Literal characters currently being typed at the end of the track. */ |
| 93 | function 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 */ |
| 110 | function getOpenTagStack(html: string): string[] { |
no outgoing calls
no test coverage detected