From 71c2f24fc64e8d38089ac9476d05e01baf448879 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 16 Nov 2010 17:02:04 -0800 Subject: remove extra toolbar directive and support multiple pre's in describe --- docs/collect.js | 4 ++-- docs/spec/collectSpec.js | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'docs') 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, ''); } function markdown(text) { - var parts = text.split(/('). replace(/\<\/pre\>/gmi, '[\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(''); + expect(doc.description). + toBe('abc'); + }); + + it('should support multiple pre blocks', function() { + TAG.description(doc, 'description', 'foo \nabcabc\n#bah\nfoo \ncba'); + expect(doc.description). + toBe('foo
' + + '' + + 'abcbah
\n\n' + + 'foo
' + + ''); + }); }); -- cgit v1.2.3cba