diff --git a/src/Htmlizer.js b/src/Htmlizer.js
index <HASH>..<HASH> 100644
--- a/src/Htmlizer.js
+++ b/src/Htmlizer.js
@@ -110,8 +110,6 @@
                             if (bindings.text && regexMap.DotNotation.test(bindings.text)) {
                                 val = saferEval(bindings.text, data);
                                 if (val !== undefined) {
-                                    //escape <,> and &.
-                                    val = (val + '').replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
                                     node.appendChild(document.createTextNode(val));
                                 }
                             }
@@ -225,7 +223,8 @@
                     }
                 }
                 if (isOpenTag && node.nodeType === 3) {
-                    html += node.nodeValue;
+                    //escape <,> and &.
+                    html += (node.nodeValue || '').replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
                 }
             }, this);
             return html;
Reverted last two commits, as escaping is not required for document.createTextNode(). However HTML escaping is required after reading from text node (in toString method).