(/** @type {EndTagToken} */ t)
| 6300 | }; |
| 6301 | |
| 6302 | const endTagInBody = (/** @type {EndTagToken} */ t) => { |
| 6303 | const name = t.name; |
| 6304 | if (name === class="st">"template") return modes.inHead(t); |
| 6305 | if (name === class="st">"select") { |
| 6306 | if (!inScope(class="st">"select")) return; |
| 6307 | generateImpliedEndTags(); |
| 6308 | popUntil(class="st">"select"); |
| 6309 | return; |
| 6310 | } |
| 6311 | if (name === class="st">"body" || name === class="st">"html") { |
| 6312 | if (!inScope(class="st">"body")) return; |
| 6313 | mode = MODE_AFTER_BODY; |
| 6314 | if (name === class="st">"html") process(t); |
| 6315 | return; |
| 6316 | } |
| 6317 | if (BLOCK_END.has(name)) { |
| 6318 | if (!inScope(name)) return; |
| 6319 | generateImpliedEndTags(); |
| 6320 | popUntil(name); |
| 6321 | return; |
| 6322 | } |
| 6323 | if (name === class="st">"form") { |
| 6324 | if (!open.some(isHtmlTemplateEl)) { |
| 6325 | const node = form; |
| 6326 | form = null; |
| 6327 | if (!node || !inScopeEl(node)) return; |
| 6328 | generateImpliedEndTags(); |
| 6329 | const idx = open.indexOf(node); |
| 6330 | if (idx !== -1) open.splice(idx, 1); |
| 6331 | } else { |
| 6332 | if (!inScope(class="st">"form")) return; |
| 6333 | generateImpliedEndTags(); |
| 6334 | popUntil(class="st">"form"); |
| 6335 | } |
| 6336 | return; |
| 6337 | } |
| 6338 | if (name === class="st">"p") { |
| 6339 | if (!inButtonScope(class="st">"p")) insertHtmlElement(class="st">"p", EMPTY_ATTRS, t.pos); |
| 6340 | closePElement(); |
| 6341 | return; |
| 6342 | } |
| 6343 | if (name === class="st">"li") { |
| 6344 | if (!inListItemScope(class="st">"li")) return; |
| 6345 | generateImpliedEndTags(class="st">"li"); |
| 6346 | popUntil(class="st">"li"); |
| 6347 | return; |
| 6348 | } |
| 6349 | if (name === class="st">"dd" || name === class="st">"dt") { |
| 6350 | if (!inScope(name)) return; |
| 6351 | generateImpliedEndTags(name); |
| 6352 | popUntil(name); |
| 6353 | return; |
| 6354 | } |
| 6355 | if (HEADING.has(name)) { |
| 6356 | let anyHeadingInScope = false; |
| 6357 | for (const h of HEADING) { |
| 6358 | if (inScope(h)) { |
| 6359 | anyHeadingInScope = true; |
no test coverage detected