diff --git a/docs/collect.js b/docs/collect.js index 4665133d..30597862 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -142,12 +142,12 @@ function escapedHtmlTag(doc, name, value) { function markdownTag(doc, name, value) { doc[name] = markdown(value.replace(/^#/gm, '##')). - replace(/\/gmi, '
').
+    replace(/\/gmi, '
').
     replace(/\<\/pre\>/gmi, '
'); } function markdown(text) { - var parts = text.split(/(
[\s\S]*<\/pre>)/);
+  var parts = text.split(/(
[\s\S]*?<\/pre>)/);
   parts.forEach(function(text, i){
     if (!text.match(/^
/)) {
       text = text.replace(//gm, '<angular/>');
diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js
index 6f82ec3d..4d398be3 100644
--- a/docs/spec/collectSpec.js
+++ b/docs/spec/collectSpec.js
@@ -185,7 +185,19 @@ describe('collect', function(){
     describe('@description', function(){
       it('should support pre blocks', function(){
         TAG.description(doc, 'description', '
abc
'); - expect(doc.description).toEqual('
abc
'); + expect(doc.description). + toBe('
abc
'); + }); + + it('should support multiple pre blocks', function() { + TAG.description(doc, 'description', 'foo \n
abc
\n#bah\nfoo \n
cba
'); + expect(doc.description). + toBe('

foo

' + + '
abc
' + + '

bah

\n\n' + + '

foo

' + + '
cba
'); + }); });