(text: string)
| 353 | } |
| 354 | |
| 355 | private processText(text: string): Action[] { |
| 356 | // Handle BEL characters embedded in text |
| 357 | const actions: Action[] = [] |
| 358 | let current = '' |
| 359 | |
| 360 | for (const char of text) { |
| 361 | if (char.charCodeAt(0) === C0.BEL) { |
| 362 | if (current) { |
| 363 | const graphemes = [...segmentGraphemes(current)] |
| 364 | if (graphemes.length > 0) { |
| 365 | actions.push({ type: 'text', graphemes, style: { ...this.style } }) |
| 366 | } |
| 367 | current = '' |
| 368 | } |
| 369 | actions.push({ type: 'bell' }) |
| 370 | } else { |
| 371 | current += char |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | if (current) { |
| 376 | const graphemes = [...segmentGraphemes(current)] |
| 377 | if (graphemes.length > 0) { |
| 378 | actions.push({ type: 'text', graphemes, style: { ...this.style } }) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | return actions |
| 383 | } |
| 384 | |
| 385 | private processSequence(seq: string): Action[] { |
| 386 | const seqType = identifySequence(seq) |
no test coverage detected