(tokens_1: Token[] | undefined)
| 92 | |
| 93 | // Get the longest word width in a cell (minimum width to avoid breaking words) |
| 94 | function getMinWidth(tokens_1: Token[] | undefined): number { |
| 95 | const text = getPlainText(tokens_1); |
| 96 | const words = text.split(/\s+/).filter(w => w.length > 0); |
| 97 | if (words.length === 0) return MIN_COLUMN_WIDTH; |
| 98 | return Math.max(...words.map(w_0 => stringWidth(w_0)), MIN_COLUMN_WIDTH); |
| 99 | } |
| 100 | |
| 101 | // Get ideal width (full content without wrapping) |
| 102 | function getIdealWidth(tokens_2: Token[] | undefined): number { |
no test coverage detected