diff --git a/src/lib/annotations/annotations.html b/src/lib/annotations/annotations.html index 1974b03fdb..8d0ed853c2 100644 --- a/src/lib/annotations/annotations.html +++ b/src/lib/annotations/annotations.html @@ -72,11 +72,11 @@ // construct and return a list of annotation records // by scanning `template`'s content // - parseAnnotations: function(template) { + parseAnnotations: function(template, stripWhiteSpace) { var list = []; var content = template._content || template.content; this._parseNodeAnnotations(content, list, - template.hasAttribute('strip-whitespace')); + stripWhiteSpace || template.hasAttribute('strip-whitespace')); return list; }, @@ -231,7 +231,7 @@ var next = node.nextSibling; if (node.localName === 'template' && !node.hasAttribute('preserve-content')) { - this._parseTemplate(node, i, list, annote); + this._parseTemplate(node, i, list, annote, stripWhiteSpace); } if (node.localName == 'slot') { node = this._replaceSlotWithContent(node); @@ -295,11 +295,11 @@ // (this is both an optimization to avoid re-stamping nested template // children and avoids a bug in Chrome where nested template children // upgrade) - _parseTemplate: function(node, index, list, parent) { + _parseTemplate: function(node, index, list, parent, stripWhiteSpace) { // TODO(sjmiles): simply altering the .content reference didn't // work (there was some confusion, might need verification) var content = document.createDocumentFragment(); - content._notes = this.parseAnnotations(node); + content._notes = this.parseAnnotations(node, stripWhiteSpace); content.appendChild(node.content); // TODO(sjmiles): using `nar` to avoid unnecessary allocation; // in general the handling of these arrays needs some cleanup diff --git a/test/unit/template-whitespace.html b/test/unit/template-whitespace.html index 5f17145f21..3f05455e72 100644 --- a/test/unit/template-whitespace.html +++ b/test/unit/template-whitespace.html @@ -40,13 +40,13 @@
A
B
- + @@ -55,7 +55,7 @@ -