Skip to content

Commit f38e07d

Browse files
committed
prep v1.9.12
2 parents c247cae + 7dd6cd7 commit f38e07d

39 files changed

+120
-64
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.9.12] - 2024-04-17
4+
5+
* [IE Fixes](https://github.com/bigskysoftware/htmx/commit/e64238dba3113c2eabe26b1e9e9ba7fe29ba3010)
6+
37
## [1.9.11] - 2024-03-15
48

59
* Fix for new issue w/ web sockets & SSE on iOS 17.4 (thanks apple!)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a
3333
## quick start
3434

3535
```html
36-
<script src="https://unpkg.com/[email protected].11"></script>
36+
<script src="https://unpkg.com/[email protected].12"></script>
3737
<!-- have a button POST a click via AJAX -->
3838
<button hx-post="/clicked" hx-swap="outerHTML">
3939
Click Me

dist/htmx.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ return (function () {
8989
sock.binaryType = htmx.config.wsBinaryType;
9090
return sock;
9191
},
92-
version: "1.9.11"
92+
version: "1.9.12"
9393
};
9494

9595
/** @type {import("./htmx").HtmxInternalApi} */
@@ -138,12 +138,12 @@ return (function () {
138138

139139
/**
140140
* @param {string} tag
141-
* @param {boolean} global
141+
* @param {boolean} [global]
142142
* @returns {RegExp}
143143
*/
144-
function makeTagRegEx(tag, global = false) {
145-
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
146-
global ? 'gim' : 'im');
144+
function makeTagRegEx(tag, global) {
145+
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
146+
!!global ? 'gim' : 'im')
147147
}
148148

149149
function parseInterval(str) {
@@ -1945,6 +1945,9 @@ return (function () {
19451945

19461946
function shouldProcessHxOn(elt) {
19471947
var attributes = elt.attributes
1948+
if (!attributes) {
1949+
return false
1950+
}
19481951
for (var j = 0; j < attributes.length; j++) {
19491952
var attrName = attributes[j].name
19501953
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@@ -1967,11 +1970,11 @@ return (function () {
19671970
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
19681971
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
19691972
while (node = iter.iterateNext()) elements.push(node)
1970-
} else {
1973+
} else if (typeof elt.getElementsByTagName === "function") {
19711974
var allElements = elt.getElementsByTagName("*")
19721975
for (var i = 0; i < allElements.length; i++) {
1973-
if (shouldProcessHxOn(allElements[i])) {
1974-
elements.push(allElements[i])
1976+
if (shouldProcessHxOn(allElements[i])) {
1977+
elements.push(allElements[i])
19751978
}
19761979
}
19771980
}

dist/htmx.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/htmx.min.js.gz

2 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"AJAX",
66
"HTML"
77
],
8-
"version": "1.9.11",
8+
"version": "1.9.12",
99
"homepage": "https://htmx.org/",
1010
"bugs": {
1111
"url": "https://github.com/bigskysoftware/htmx/issues"

src/htmx.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ return (function () {
8989
sock.binaryType = htmx.config.wsBinaryType;
9090
return sock;
9191
},
92-
version: "1.9.11"
92+
version: "1.9.12"
9393
};
9494

9595
/** @type {import("./htmx").HtmxInternalApi} */
@@ -138,12 +138,12 @@ return (function () {
138138

139139
/**
140140
* @param {string} tag
141-
* @param {boolean} global
141+
* @param {boolean} [global]
142142
* @returns {RegExp}
143143
*/
144-
function makeTagRegEx(tag, global = false) {
145-
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
146-
global ? 'gim' : 'im');
144+
function makeTagRegEx(tag, global) {
145+
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
146+
!!global ? 'gim' : 'im')
147147
}
148148

149149
function parseInterval(str) {
@@ -1945,6 +1945,9 @@ return (function () {
19451945

19461946
function shouldProcessHxOn(elt) {
19471947
var attributes = elt.attributes
1948+
if (!attributes) {
1949+
return false
1950+
}
19481951
for (var j = 0; j < attributes.length; j++) {
19491952
var attrName = attributes[j].name
19501953
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@@ -1967,11 +1970,11 @@ return (function () {
19671970
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
19681971
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
19691972
while (node = iter.iterateNext()) elements.push(node)
1970-
} else {
1973+
} else if (typeof elt.getElementsByTagName === "function") {
19711974
var allElements = elt.getElementsByTagName("*")
19721975
for (var i = 0; i < allElements.length; i++) {
1973-
if (shouldProcessHxOn(allElements[i])) {
1974-
elements.push(allElements[i])
1976+
if (shouldProcessHxOn(allElements[i])) {
1977+
elements.push(allElements[i])
19751978
}
19761979
}
19771980
}

test/core/ajax.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,11 @@ describe("Core htmx AJAX Tests", function(){
12371237
})
12381238

12391239
it('properly handles inputs external to form', function () {
1240+
if (!supportsFormAttribute()) {
1241+
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
1242+
this.skip()
1243+
return
1244+
}
12401245
var values;
12411246
this.server.respondWith("Post", "/test", function (xhr) {
12421247
values = getParameters(xhr);
@@ -1287,6 +1292,11 @@ describe("Core htmx AJAX Tests", function(){
12871292
})
12881293

12891294
it("can associate submit buttons from outside a form with the current version of the form after swap", function(){
1295+
if (!supportsFormAttribute()) {
1296+
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
1297+
this.skip()
1298+
return
1299+
}
12901300
const template = '<form ' +
12911301
'id="hello" ' +
12921302
'hx-target="#hello" ' +

test/core/regressions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ describe("Core htmx Regression Tests", function(){
246246
})
247247

248248
it("script tags only execute once using templates", function(done) {
249+
if (!supportsTemplates()) {
250+
this._runnable.title += " - Skipped as IE11 doesn't support templates"
251+
this.skip()
252+
return
253+
}
249254
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
250255
htmx.config.useTemplateFragments = true
251256

@@ -267,6 +272,11 @@ describe("Core htmx Regression Tests", function(){
267272
})
268273

269274
it("script tags only execute once when nested using templates", function(done) {
275+
if (!supportsTemplates()) {
276+
this._runnable.title += " - Skipped as IE11 doesn't support templates"
277+
this.skip()
278+
return
279+
}
270280
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
271281
htmx.config.useTemplateFragments = true
272282

www/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
base_url = "https://htmx.org"
1+
base_url = "https://v1.htmx.org"
22
title = "</> htmx - high power tools for html"
33
theme = "htmx-theme"
44

0 commit comments

Comments
 (0)