(h: Highlight)
| 648 | } |
| 649 | |
| 650 | function removeNewlines(h: Highlight): void { |
| 651 | h.lines = h.lines.map(line => |
| 652 | line.flatMap(([style, text]) => |
| 653 | text |
| 654 | .split('\n') |
| 655 | .filter(p => p.length > 0) |
| 656 | .map((p): Block => [style, p]), |
| 657 | ), |
| 658 | ) |
| 659 | } |
| 660 | |
| 661 | function charWidth(ch: string): number { |
| 662 | return stringWidth(ch) |