mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 05:21:18 +00:00
parent
32edfba6f2
commit
1e1b7cf94a
@ -803,7 +803,8 @@ return (function () {
|
||||
forEach(fragment.querySelectorAll("[id]"), function (newNode) {
|
||||
if (newNode.id && newNode.id.length > 0) {
|
||||
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) {
|
||||
var newAttributes = newNode.cloneNode();
|
||||
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