diff --git a/src/htmx.js b/src/htmx.js index 1498c661..f949da04 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -583,7 +583,7 @@ var htmx = (function() { */ function makeFragment(response) { // strip head tag to determine shape of response we are dealing with - const responseWithNoHead = response.replace(/]*)?>.*?<\/head>/is, '') + const responseWithNoHead = response.replace(/]*)?>[\s\S]*?<\/head>/i, '') const startTag = getStartTag(responseWithNoHead) /** @type DocumentFragmentWithTitle */ let fragment