(text, start, quote)
| 214 | } |
| 215 | |
| 216 | function findClosingQuote(text, start, quote) { |
| 217 | let i = start; |
| 218 | while (i < text.length) { |
| 219 | if (text[i] === '\\') { i += 2; continue; } |
| 220 | if (text[i] === quote) return i; |
| 221 | i++; |
| 222 | } |
| 223 | return start; // unclosed |
| 224 | } |
| 225 | |
| 226 | // ===== Error formatting ===== |
| 227 |