From cda04f48ed3b9d1bc91a2d899a805640b617fc3c Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 6 Aug 2026 17:41:16 -0400 Subject: [PATCH] Preserve child head content in HTMX embeds --- index.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 0b701cd..43cdbd3 100644 --- a/index.js +++ b/index.js @@ -416,15 +416,32 @@ function decoratePage(html, { headInjection, source } = {}) { return $.html(); } -// HTMX partial: stamp provenance on the swapped-in elements (an oob swap loses -// its own attrs, so we descend into its children) and append an out-of-band -// so head injection still reaches the page. +// Carry rendered head content through HTMX with a neutral OOB wrapper. A +// literal in an HTMX response is discarded by the browser's fragment +// parser, and HTMX does not discover a top-level