| 1538 | // Fails an incomplete token over maxTokenSize, preferring an error in the |
| 1539 | // first maxTokenSize + 1 characters of markup, as `parse` does |
| 1540 | private checkPending(): void { |
| 1541 | const text = this.scanner.state === S_TEXT |
| 1542 | if (this.pendingLength + (text ? this.textSize : 0) <= this.maxTokenSize) return |
| 1543 | if (!text) { |
| 1544 | this.load(this.pending!.join("").slice(0, this.maxTokenSize + 1), this.pendingStart) |
| 1545 | this.markup(this.buf, 0) |
| 1546 | } |
| 1547 | throw this.tokenLimit(this.pendingStart) |
| 1548 | } |
| 1549 | |
| 1550 | private parse(final: boolean): void { |
| 1551 | const s = this.buf |