From d600c608e3bf01be444a9fe25119670d55f7f757 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 7 Feb 2011 15:55:23 -0800 Subject: markdown pre-processor should strip all the extra indentation - split trim into trim and indent - merged my indentation code with trim - cleaned up some small issues --- docs/spec/ngdocSpec.js | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'docs/spec/ngdocSpec.js') diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 95e86d99..35dcc4cb 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -143,6 +143,33 @@ describe('ngdoc', function(){ toMatch('

One

first line\n' + + 'second line

\n\n' + + '
third line\n' +
+                ' fourth line\n
\n\n' + + '

fifth line

'); + }); + + it('should unindent text before processing based on the first line', function() { + expect(new Doc().markdown(' first line\n\n' + + ' second line\n' + + ' third line\n' + + ' fourth line\n\n' + + ' fifth line')). + toMatch('

first line

\n\n' + + '
second line\n' +
+                'third line\n' +
+                ' fourth line\n
\n\n' + + '

fifth line

'); + }); + + }); describe('trim', function(){ @@ -163,7 +190,7 @@ describe('ngdoc', function(){ var methodB = new Doc({name:'methodB', methodOf:'angular.service.abc'}); var propA = new Doc({name:'propA', propertyOf:'angular.service.abc'}); var propB = new Doc({name:'propB', propertyOf:'angular.service.abc'}); - ;var docs = [methodB, methodA, propB, propA, parent]; // keep wrong order; + var docs = [methodB, methodA, propB, propA, parent]; // keep wrong order; ngdoc.merge(docs); expect(docs.length).toEqual(1); expect(docs[0].name).toEqual('angular.service.abc'); @@ -185,7 +212,7 @@ describe('ngdoc', function(){ name : 'number', optional: false, 'default' : undefined, - description : '

Number \n to format.

' }]); + description : '

Number \nto format.

' }]); }); it('should parse with default and optional', function(){ @@ -267,7 +294,7 @@ describe('ngdoc', function(){ var doc = new Doc("@returns {string} description\n new line\n another line"); doc.parse(); expect(doc.returns). - toEqual({type: 'string', description: '

description\n new line\n another line

'}); + toEqual({type: 'string', description: '

description\nnew line\nanother line

'}); }); }); -- cgit v1.2.3