JSDOC/PrettyPrint.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 29 Jun 2010 10:29:37 +0000 (18:29 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 29 Jun 2010 10:29:37 +0000 (18:29 +0800)
JSDOC/PrettyPrint.js

index 13e154a..22564a5 100644 (file)
@@ -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 += '<span class="with-ident2">' +
-                htmlescape(toks[i].data) + '</span>';
+                escapeHTML(toks[i].data) + '</span>';
                 continue;
                 
         }
-        r += htmlescape(toks[i].data).replace(/\n/g, '<BR>');
+        r += escapeHTML(toks[i].data).replace(/\n/g, '<BR>');
     }
     if (cs.length) r +='</span>';
     return '<code class="jsdoc-pretty">'+r+'</code>';
     
         
 }
+function  escapeHTML() {                                        
+    return(                                                                 
+        this.replace(/&/g,'&amp;').                                         
+            replace(/>/g,'&gt;').                                           
+            replace(/</g,'&lt;').                                           
+            replace(/"/g,'&quot;')                                         
+    );                                                                      
+};
\ No newline at end of file