MCPcopy
hub / github.com/webpack/webpack / contentModeAfterOpenTag

Function contentModeAfterOpenTag

lib/html/syntax.js:475–488  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473 // special end-tag states) is materialized only when a special mode is
474 // actually entered — ordinary tags never allocate it.
475 const contentModeAfterOpenTag = () => {
476 const m = getContentModeForRange(input, lastOpenTagStart, lastOpenTagEnd);
477 // Ordinary tags stay in data state regardless of `isForeign` (which only
478 // vetoes a switch *into* a special mode), so skip the per-open-tag
479 // `isForeign` callback for them.
480 if (m === STATE_DATA) return STATE_DATA;
481 if (callbacks.isForeign !== undefined && callbacks.isForeign()) {
482 return STATE_DATA;
483 }
484 lastOpenTagName = input
485 .slice(lastOpenTagStart, lastOpenTagEnd)
486 .toLowerCase();
487 return m;
488 };
489
490 // HTML fragment parsing: seed the tokenizer with the context element's
491 // content mode (e.g. a `textarea`/`style`/`script` context starts in

Callers 1

walkHtmlTokensFunction · 0.85

Calls 2

getContentModeForRangeFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected