mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7de777de6d
@ -812,7 +812,8 @@ return (function () {
|
|||||||
forEach(fragment.querySelectorAll("[id]"), function (newNode) {
|
forEach(fragment.querySelectorAll("[id]"), function (newNode) {
|
||||||
if (newNode.id && newNode.id.length > 0) {
|
if (newNode.id && newNode.id.length > 0) {
|
||||||
var normalizedId = newNode.id.replace("'", "\\'");
|
var normalizedId = newNode.id.replace("'", "\\'");
|
||||||
var oldNode = parentNode.querySelector(newNode.tagName + "[id='" + normalizedId + "']");
|
var normalizedTag = newNode.tagName.replace(':', '\\:');
|
||||||
|
var oldNode = parentNode.querySelector(normalizedTag + "[id='" + normalizedId + "']");
|
||||||
if (oldNode && oldNode !== parentNode) {
|
if (oldNode && oldNode !== parentNode) {
|
||||||
var newAttributes = newNode.cloneNode();
|
var newAttributes = newNode.cloneNode();
|
||||||
cloneAttributes(newNode, oldNode);
|
cloneAttributes(newNode, oldNode);
|
||||||
|
@ -979,4 +979,14 @@ describe("Core htmx AJAX Tests", function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should load tags with colon in their names', function() {
|
||||||
|
this.server.respondWith('GET', '/test', '<with:colon id="foobar">Foobar</with:colon>');
|
||||||
|
|
||||||
|
var btn = make('<button hx-get="/test">Give me colons!</button>');
|
||||||
|
btn.click();
|
||||||
|
this.server.respond();
|
||||||
|
|
||||||
|
btn.innerHTML.should.equal('<with:colon id="foobar">Foobar</with:colon>');
|
||||||
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user