File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed
test/manual/hxboost_partial_template_parsing Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -337,22 +337,10 @@ var htmx = (function() {
337337 return '[hx-' + verb + '], [data-hx-' + verb + ']'
338338 } ) . join ( ', ' )
339339
340- const HEAD_TAG_REGEX = makeTagRegEx ( 'head' )
341-
342340 //= ===================================================================
343341 // Utilities
344342 //= ===================================================================
345343
346- /**
347- * @param {string } tag
348- * @param {boolean } global
349- * @returns {RegExp }
350- */
351- function makeTagRegEx ( tag , global = false ) {
352- return new RegExp ( `<${ tag } (\\s[^>]*>|>)([\\s\\S]*?)<\\/${ tag } >` ,
353- global ? 'gim' : 'im' )
354- }
355-
356344 /**
357345 * Parses an interval string consistent with the way htmx does. Useful for plugins that have timing-related attributes.
358346 *
@@ -595,7 +583,7 @@ var htmx = (function() {
595583 */
596584 function makeFragment ( response ) {
597585 // strip head tag to determine shape of response we are dealing with
598- const responseWithNoHead = response . replace ( HEAD_TAG_REGEX , '' )
586+ const responseWithNoHead = response . replace ( / < h e a d ( \s [ ^ > ] * ) ? > . * ? < \/ h e a d > / is , '' )
599587 const startTag = getStartTag ( responseWithNoHead )
600588 /** @type DocumentFragmentWithTitle */
601589 let fragment
Original file line number Diff line number Diff line change 1919 </ style >
2020
2121 < script src ="../../../src/htmx.js " hx-preserve ="true "> </ script >
22- < script src ="../../../src/ ext/head-support.js " hx-preserve ="true "> </ script >
22+ < script src ="
https://unpkg.com/htmx- ext[email protected] /head-support.js"
hx-preserve ="
true "
> </ script > 2323</ head >
2424< body hx-ext ="head-support " hx-boost ="true ">
2525 < header hx-push-url ="false " hx-target ="main " hx-swap ="innerHTML ">
@@ -38,4 +38,4 @@ <h1># Index</h1>
3838 </ ul >
3939 </ main >
4040</ body >
41- </ html >
41+ </ html >
You can’t perform that action at this time.
0 commit comments