diff options
| author | Igor Minar | 2011-01-19 13:02:50 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2011-01-19 15:53:58 -0800 | 
| commit | 2c0f7ffe3af2b2c7c84cea49456728d1ac9b3bfe (patch) | |
| tree | d0cbca4126763df189c25234334490690aa41b60 /docs/src/ngdoc.js | |
| parent | a5eb3ed107034cce5b7de3ec3f8a43ff3a379fa1 (diff) | |
| download | angular.js-2c0f7ffe3af2b2c7c84cea49456728d1ac9b3bfe.tar.bz2 | |
ngdoc should escape content of pre in markdown
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 8 | 
1 files changed, 5 insertions, 3 deletions
| 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(/^<pre>/)) { -      text = text. -        replace(/^<pre>/, '<div ng:non-bindable><pre class="brush: js; html-script: true;">'). -        replace(/<\/pre>/, '</pre></div>'); +      text = text.replace(/^<pre>([\s\S]*)<\/pre>/mi, function(_, content){ +        return '<div ng:non-bindable><pre class="brush: js; html-script: true;">' + +                content.replace(/</g, '<').replace(/>/g, '>') + +               '</pre></div>'; +      });      } else {        text = text.replace(/<angular\/>/gm, '<tt><angular/></tt>');        text = new Showdown.converter().makeHtml(text.replace(/^#/gm, '###')); | 
