From: Alan Knowles Date: Tue, 29 Jun 2010 10:29:37 +0000 (+0800) Subject: JSDOC/PrettyPrint.js X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=commitdiff_plain;h=c35d0956f1df86e3544a9a19876b78fa9eeeee7f JSDOC/PrettyPrint.js --- diff --git a/JSDOC/PrettyPrint.js b/JSDOC/PrettyPrint.js index 13e154a..22564a5 100644 --- a/JSDOC/PrettyPrint.js +++ b/JSDOC/PrettyPrint.js @@ -40,7 +40,6 @@ function toPretty(str) return 'keyword'; } return 'syntax' - } // loop through and print it...? @@ -56,14 +55,22 @@ function toPretty(str) if (toks[i].identifier) { r += '' + - htmlescape(toks[i].data) + ''; + escapeHTML(toks[i].data) + ''; continue; } - r += htmlescape(toks[i].data).replace(/\n/g, '
'); + r += escapeHTML(toks[i].data).replace(/\n/g, '
'); } if (cs.length) r +=''; return ''+r+''; } +function escapeHTML() { + return( + this.replace(/&/g,'&'). + replace(/>/g,'>'). + replace(/