MCPcopy
hub / github.com/webpack/webpack / anyOtherEndTag

Function anyOtherEndTag

lib/html/syntax.js:5962–5975  ·  view source on GitHub ↗
(/** @type {string} */ name)

Source from the content-addressed store, hash-verified

5960 // "any other end tag" in body: pop to the matching open element, stopping at
5961 // the first special element; also the adoption agency's no-element fallback.
5962 const anyOtherEndTag = (/** @type {string} */ name) => {
5963 for (let i = open.length - 1; i >= 0; i--) {
5964 const node = open[i];
5965 if (node.namespace === NS_HTML && node.tagName === name) {
5966 generateImpliedEndTags(name);
5967 while (open.length > i) {
5968 open[open.length - 1].end = tokenEnd;
5969 open.pop();
5970 }
5971 return;
5972 }
5973 if (isSpecial(node)) return;
5974 }
5975 };
5976
5977 const startTagInBody = (/** @type {StartTagToken} */ t) => {
5978 const name = t.name;

Callers 2

startTagInBodyFunction · 0.85
endTagInBodyFunction · 0.85

Calls 3

generateImpliedEndTagsFunction · 0.85
isSpecialFunction · 0.85
popMethod · 0.80

Tested by

no test coverage detected