Skip to content

Commit f18e132

Browse files
committed
fix page title HTML entities being escaped with hx-boost
1 parent d121ba5 commit f18e132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/htmx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ var htmx = (() => {
11521152
__makeFragment(text) {
11531153
let response = text.replace(/<hx-partial(\s+|>)/gi, '<template partial$1').replace(/<\/hx-partial>/gi, '</template>');
11541154
let title = '';
1155-
response = response.replace(/<title[^>]*>([\s\S]*?)<\/title>/i, (m, t) => (title = t, ''));
1155+
response = response.replace(/<title[^>]*>([\s\S]*?)<\/title>/i, (m, t) => (title = this.__parseHTML('<title>' + t).querySelector('title').textContent, ''));
11561156
let responseWithNoHead = response.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i, '');
11571157
let startTag = responseWithNoHead.match(/<([a-z][^\/>\x20\t\r\n\f]*)/i)?.[1]?.toLowerCase();
11581158

0 commit comments

Comments
 (0)