aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorIgor Minar2012-12-04 18:24:15 +0100
committerIgor Minar2013-05-08 07:57:34 -0700
commit86b33eb3f1360a4cefb5ebf522b6649f9c55db55 (patch)
tree08c6f14278eee56439b11b1ab6c4dcb3e9e2846c /test/testabilityPatch.js
parent202087f03da20741b8e4b248e53994a6ff1cce3e (diff)
downloadangular.js-86b33eb3f1360a4cefb5ebf522b6649f9c55db55.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 679294ee..732669c5 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -120,11 +120,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 || [];