diff --git a/lib/IHP/static/vendor/ihp-ssc.js b/lib/IHP/static/vendor/ihp-ssc.js index 07c18bc72..f73a30c6e 100644 --- a/lib/IHP/static/vendor/ihp-ssc.js +++ b/lib/IHP/static/vendor/ihp-ssc.js @@ -75,7 +75,12 @@ function evaluateNodeOperation(component, nodeOperation) { function createNode(component, nodeOperation) { var newElement = htmlStringToDomNode(nodeOperation.html); - nodeOperation.domNode.appendChild(newElement); + var domNode = nodeOperation.domNode; + if (domNode.nodeType == Node.TEXT_NODE) { + domNode.replaceWith(newElement); + } else { + domNode.appendChild(newElement); + } } function updateTextContent(component, nodeOperation) {