couple of bugfixes identified while importing from VB

This commit is contained in:
Régis Hanol
2014-03-07 10:44:04 +01:00
parent 7670598658
commit f25bcc5067
5 changed files with 15 additions and 11 deletions

View File

@@ -437,11 +437,15 @@
};
function escapeHTML( text ) {
return text.replace( /&/g, "&" )
.replace( /</g, "&lt;" )
.replace( />/g, "&gt;" )
.replace( /"/g, "&quot;" )
.replace( /'/g, "&#39;" );
if (text && text.length > 0) {
return text.replace( /&/g, "&amp;" )
.replace( /</g, "&lt;" )
.replace( />/g, "&gt;" )
.replace( /"/g, "&quot;" )
.replace( /'/g, "&#39;" );
} else {
return "";
}
}
function render_tree( jsonml ) {