mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
handle html parsing when script tag starts content
fixes https://github.com/bigskysoftware/htmx/issues/228
This commit is contained in:
parent
71a9b48dd4
commit
e0b5b52979
@ -161,6 +161,8 @@ return (function () {
|
||||
case "td":
|
||||
case "th":
|
||||
return parseHTML("<table><tbody><tr>" + resp + "</tr></tbody></table>", 3);
|
||||
case "script":
|
||||
return parseHTML("<div>" + resp + "</div>", 1);
|
||||
default:
|
||||
return parseHTML(resp, 0);
|
||||
}
|
||||
|
@ -546,6 +546,23 @@ describe("Core htmx AJAX Tests", function(){
|
||||
}
|
||||
});
|
||||
|
||||
it('stand alone script nodes evaluate', function()
|
||||
{
|
||||
var globalWasCalled = false;
|
||||
window.callGlobal = function() {
|
||||
globalWasCalled = true;
|
||||
}
|
||||
try {
|
||||
this.server.respondWith("GET", "/test", "<script type='text/javascript'>callGlobal()</script>");
|
||||
var div = make("<div hx-get='/test'></div>");
|
||||
div.click();
|
||||
this.server.respond();
|
||||
globalWasCalled.should.equal(true);
|
||||
} finally {
|
||||
delete window.callGlobal;
|
||||
}
|
||||
});
|
||||
|
||||
it('child script nodes evaluate when children', function()
|
||||
{
|
||||
var globalWasCalled = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user