MCPcopy
hub / github.com/webpack/webpack / reconstructAfe

Function reconstructAfe

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

Source from the content-addressed store, hash-verified

5021 }
5022 };
5023 const reconstructAfe = () => {
5024 if (afe.length === 0) return;
5025 let i = afe.length - 1;
5026 if (afe[i].marker || open.includes(afeEl(afe[i]))) return;
5027 while (i > 0) {
5028 i--;
5029 if (afe[i].marker || open.includes(afeEl(afe[i]))) {
5030 i++;
5031 break;
5032 }
5033 }
5034 for (; i < afe.length; i++) {
5035 const e = afe[i];
5036 const el = mkEl(
5037 afeEl(e).tagName,
5038 afeEl(e).namespace,
5039 cloneAttrs(afeEl(e).attributes),
5040 null
5041 );
5042 const place = appropriatePlace();
5043 insertAtPlace(place, el);
5044 open.push(el);
5045 afe[i] = { element: el };
5046 }
5047 };
5048
5049 // ---- close p ----
5050 const closePElement = () => {

Callers 3

buildHtmlAstFunction · 0.85
startTagInBodyFunction · 0.85
endTagInBodyFunction · 0.85

Calls 6

afeElFunction · 0.85
mkElFunction · 0.85
cloneAttrsFunction · 0.85
appropriatePlaceFunction · 0.85
insertAtPlaceFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected