MCPcopy
hub / github.com/webpack/webpack / pushAfe

Function pushAfe

lib/html/syntax.js:4975–4993  ·  view source on GitHub ↗
(/** @type {HtmlElement} */ el)

Source from the content-addressed store, hash-verified

4973
4974 // ---- active formatting elements ----
4975 const pushAfe = (/** @type {HtmlElement} */ el) => {
4976 let count = 0;
4977 for (let i = afe.length - 1; i >= 0; i--) {
4978 const e = afe[i];
4979 if (e.marker) break;
4980 if (
4981 afeEl(e).tagName === el.tagName &&
4982 afeEl(e).namespace === el.namespace &&
4983 sameAttrs(afeEl(e), el)
4984 ) {
4985 count++;
4986 if (count === 3) {
4987 afe.splice(i, 1);
4988 break;
4989 }
4990 }
4991 }
4992 afe.push({ element: el });
4993 };
4994 const sameAttrs = (
4995 /** @type {HtmlElement} */ a,
4996 /** @type {HtmlElement} */ b

Callers 1

startTagInBodyFunction · 0.85

Calls 3

afeElFunction · 0.85
sameAttrsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected