diff options
| author | Igor Minar | 2012-12-04 18:24:15 +0100 |
|---|---|---|
| committer | Igor Minar | 2013-05-09 05:23:39 -0700 |
| commit | 9039ddbb568bdbd46cfbee2729b6f781ac413041 (patch) | |
| tree | 3e848867e6bde818e3a70c2d19563f78f80c94a9 /test/testabilityPatch.js | |
| parent | 8f8510fc22fe434a55d3cc3ef78bc168f1a8b606 (diff) | |
| download | angular.js-9039ddbb568bdbd46cfbee2729b6f781ac413041.tar.bz2 | |
test(sortedHtml): fix comment support in sortedHtml helper
Diffstat (limited to 'test/testabilityPatch.js')
| -rw-r--r-- | test/testabilityPatch.js | 3 |
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, '<'). replace(/>/g, '>'); + } else if (node.nodeName == "#comment") { + html += '<!--' + node.nodeValue + '-->'; } else { html += '<' + (node.nodeName || '?NOT_A_NODE?').toLowerCase(); var attributes = node.attributes || []; |
