mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-08 18:12:55 +08:00
test(sortedHtml): fix comment support in sortedHtml helper
This commit is contained in:
@@ -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 || [];
|
||||
|
||||
Reference in New Issue
Block a user