diff options
author | Carson Gross <carson@bigsky.software> | 2024-04-17 10:54:49 -0600 |
---|---|---|
committer | Carson Gross <carson@bigsky.software> | 2024-04-17 10:54:49 -0600 |
commit | f38e07d4be8145a39e2bb477ec9fcc56bdd2d16d (patch) | |
tree | 5a2e1d86c5012f2943ccf906fafe962e35c1abf7 /src/htmx.js | |
parent | c247cae9bf04b5b274d3bd65937541e8224a359c (diff) | |
parent | 7dd6cd722437ab1f07b1328602ec2e301a6a0290 (diff) | |
download | htmx-f38e07d4be8145a39e2bb477ec9fcc56bdd2d16d.tar.gz htmx-f38e07d4be8145a39e2bb477ec9fcc56bdd2d16d.zip |
prep v1.9.12v1.9.12
Diffstat (limited to 'src/htmx.js')
-rw-r--r-- | src/htmx.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/htmx.js b/src/htmx.js index 0e31707b..597c9b3b 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -89,7 +89,7 @@ return (function () { sock.binaryType = htmx.config.wsBinaryType; return sock; }, - version: "1.9.11" + version: "1.9.12" }; /** @type {import("./htmx").HtmxInternalApi} */ @@ -138,12 +138,12 @@ return (function () { /** * @param {string} tag - * @param {boolean} global + * @param {boolean} [global] * @returns {RegExp} */ - function makeTagRegEx(tag, global = false) { - return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`, - global ? 'gim' : 'im'); + function makeTagRegEx(tag, global) { + return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>', + !!global ? 'gim' : 'im') } function parseInterval(str) { @@ -1945,6 +1945,9 @@ return (function () { function shouldProcessHxOn(elt) { var attributes = elt.attributes + if (!attributes) { + return false + } for (var j = 0; j < attributes.length; j++) { var attrName = attributes[j].name if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") || @@ -1967,11 +1970,11 @@ return (function () { var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' + ' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt) while (node = iter.iterateNext()) elements.push(node) - } else { + } else if (typeof elt.getElementsByTagName === "function") { var allElements = elt.getElementsByTagName("*") for (var i = 0; i < allElements.length; i++) { - if (shouldProcessHxOn(allElements[i])) { - elements.push(allElements[i]) + if (shouldProcessHxOn(allElements[i])) { + elements.push(allElements[i]) } } } |