From 0d8e19c26f941004b0472fe56b2601dc86887668 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 9 Jan 2013 22:23:50 +0000 Subject: fix($compile): do not wrap empty root text nodes in spans Closes #1059 --- src/ng/compile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ng/compile.js') diff --git a/src/ng/compile.js b/src/ng/compile.js index 08c161f7..7ec8c3ce 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -318,7 +318,7 @@ function $CompileProvider($provide) { // We can not compile top level text elements since text nodes can be merged and we will // not be able to attach scope data to them, so we will wrap them in forEach($compileNodes, function(node, index){ - if (node.nodeType == 3 /* text node */) { + if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) { $compileNodes[index] = jqLite(node).wrap('').parent()[0]; } }); -- cgit v1.2.3