diff options
| author | Pete Bacon Darwin | 2013-01-09 22:23:50 +0000 |
|---|---|---|
| committer | Igor Minar | 2013-01-17 00:28:56 -0800 |
| commit | 0d8e19c26f941004b0472fe56b2601dc86887668 (patch) | |
| tree | c0288bc1f9e187f7611ec3f537f20b93d1f4d9a8 /src/ng | |
| parent | ed2fd2d0caad4e4b45f79bb39fd2a8b03fea8faa (diff) | |
| download | angular.js-0d8e19c26f941004b0472fe56b2601dc86887668.tar.bz2 | |
fix($compile): do not wrap empty root text nodes in spans
Closes #1059
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/compile.js | 2 |
1 files changed, 1 insertions, 1 deletions
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 <span> 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('<span></span>').parent()[0]; } }); |
