mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 04:50:43 +00:00
Let templates have plaintext as contents (fixes 2702) (#2708)
let templates have plaintext as contents (fixes 2702)
This commit is contained in:
parent
d9eb6d74f8
commit
0f3b2b4a92
@ -1854,7 +1854,7 @@ var htmx = (function() {
|
||||
findAndSwapOobElements(fragment, settleInfo)
|
||||
forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
|
||||
findAndSwapOobElements(template.content, settleInfo)
|
||||
if (template.content.childElementCount === 0) {
|
||||
if (template.content.childElementCount === 0 && template.content.textContent.trim() === '') {
|
||||
// Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
|
||||
template.remove()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user