(text: string)
| 307 | } |
| 308 | |
| 309 | private processText(text: string): Action[] { |
| 310 | // Handle BEL characters embedded in text |
| 311 | const actions: Action[] = [] |
| 312 | let current = '' |
| 313 | |
| 314 | for (const char of text) { |
| 315 | if (char.charCodeAt(0) === C0.BEL) { |
| 316 | if (current) { |
| 317 | const graphemes = [...segmentGraphemes(current)] |
| 318 | if (graphemes.length > 0) { |
| 319 | actions.push({ type: 'text', graphemes, style: { ...this.style } }) |
| 320 | } |
| 321 | current = '' |
| 322 | } |
| 323 | actions.push({ type: 'bell' }) |
| 324 | } else { |
| 325 | current += char |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | if (current) { |
| 330 | const graphemes = [...segmentGraphemes(current)] |
| 331 | if (graphemes.length > 0) { |
| 332 | actions.push({ type: 'text', graphemes, style: { ...this.style } }) |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | return actions |
| 337 | } |
| 338 | |
| 339 | private processSequence(seq: string): Action[] { |
| 340 | const seqType = identifySequence(seq) |
no test coverage detected