From 809ca94e1cca45fbf40a2bfd84e8770536e3624b Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 7 Dec 2010 16:07:14 -0800 Subject: @returns tag should allow the content to be split into multiple lines --- docs/collect.js | 2 +- docs/spec/collectSpec.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/collect.js b/docs/collect.js index e2f3b940..e1af14ef 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -208,7 +208,7 @@ function propertyTag(doc, name, value) { } function returnsTag(doc, name, value) { - var match = value.match(/^{(\S+)}\s+(.*)?/); + var match = value.match(/^{(\S+)}\s+([\s\S]*)?/); if (match) { var tag = { diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js index 86af0810..f0783bdf 100644 --- a/docs/spec/collectSpec.js +++ b/docs/spec/collectSpec.js @@ -182,6 +182,12 @@ describe('collect', function(){ TAG.returns(doc, 'returns', '{string} descrip *tion*'); expect(doc.returns).toEqual({type: 'string', description: 'descrip tion'}); }); + + it('should support multiline content', function() { + TAG.returns(doc, 'returns', '{string} description\n new line\n another line'); + expect(doc.returns). + toEqual({type: 'string', description: 'description\n new line\n another line'}); + }); }); describe('@description', function(){ -- cgit v1.2.3