aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorIgor Minar2012-12-04 18:24:15 +0100
committerIgor Minar2013-05-09 05:23:39 -0700
commit9039ddbb568bdbd46cfbee2729b6f781ac413041 (patch)
tree3e848867e6bde818e3a70c2d19563f78f80c94a9 /test/testabilityPatch.js
parent8f8510fc22fe434a55d3cc3ef78bc168f1a8b606 (diff)
downloadangular.js-9039ddbb568bdbd46cfbee2729b6f781ac413041.tar.bz2
test(sortedHtml): fix comment support in sortedHtml helper
Diffstat (limited to 'test/testabilityPatch.js')
-rw-r--r--test/testabilityPatch.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index cef00993..dd0f4f97 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -91,11 +91,14 @@ function dealoc(obj) {
function sortedHtml(element, showNgClass) {
var html = "";
forEach(jqLite(element), function toString(node) {
+
if (node.nodeName == "#text") {
html += node.nodeValue.
replace(/&(\w+[&;\W])?/g, function(match, entity){return entity?match:'&';}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
+ } else if (node.nodeName == "#comment") {
+ html += '<!--' + node.nodeValue + '-->';
} else {
html += '<' + (node.nodeName || '?NOT_A_NODE?').toLowerCase();
var attributes = node.attributes || [];