From 2c0f7ffe3af2b2c7c84cea49456728d1ac9b3bfe Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 19 Jan 2011 13:02:50 -0800 Subject: ngdoc should escape content of pre in markdown --- docs/src/ngdoc.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/src/ngdoc.js') diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index f1ca8d7e..038dda06 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -421,9 +421,11 @@ function markdown (text) { parts.forEach(function(text, i){ if (text.match(/^
/)) {
-      text = text.
-        replace(/^
/, '
').
-        replace(/<\/pre>/, '
'); + text = text.replace(/^
([\s\S]*)<\/pre>/mi, function(_, content){
+        return '
' +
+                content.replace(//g, '>') +
+               '
'; + }); } else { text = text.replace(//gm, '<angular/>'); text = new Showdown.converter().makeHtml(text.replace(/^#/gm, '###')); -- cgit v1.2.3