| 549 | * @returns {number} next position |
| 550 | */ |
| 551 | const emitOpenTag = (endPos, selfClosing) => { |
| 552 | let nextPos = endPos; |
| 553 | if (callbacks.openTag !== undefined) { |
| 554 | nextPos = callbacks.openTag( |
| 555 | input, |
| 556 | tagStart, |
| 557 | endPos, |
| 558 | tagNameStart, |
| 559 | tagNameEnd, |
| 560 | selfClosing |
| 561 | ); |
| 562 | } |
| 563 | if (!selfClosing) { |
| 564 | // Record offsets only; `contentModeAfterOpenTag` lowercases lazily. |
| 565 | lastOpenTagStart = tagNameStart; |
| 566 | lastOpenTagEnd = tagNameEnd; |
| 567 | } |
| 568 | tagHasAttributes = false; |
| 569 | textStart = nextPos; |
| 570 | return nextPos; |
| 571 | }; |
| 572 | |
| 573 | /** |
| 574 | * @param {number} endPos end position |