MCPcopy
hub / github.com/webpack/webpack / flushText

Function flushText

lib/html/syntax.js:504–516  ·  view source on GitHub ↗
(endPos)

Source from the content-addressed store, hash-verified

502 * @param {number} endPos end position
503 */
504 const flushText = (endPos) => {
505 if (textStart < endPos) {
506 if (callbacks.text !== undefined) {
507 callbacks.text(input, textStart, endPos);
508 }
509 // Advance `textStart` so a second `flushText` for the same span
510 // (e.g. from the EOF handler after a tag-open transition already
511 // flushed the pending text) is a no-op rather than a duplicate
512 // emit. emitOpenTag / emitCloseTag overwrite `textStart` with
513 // their own `nextPos` anyway, so this doesn't shift their start.
514 textStart = endPos;
515 }
516 };
517
518 /**
519 * @param {number} endPos end position

Callers 1

walkHtmlTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected