From 258cae83dc1a03b6b878a7b4236c499288cd2624 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 8 Jul 2013 21:58:14 -0400 Subject: chore(ngdocs): replace showdown.js with marked.js --- docs/spec/ngdocSpec.js | 79 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 40 deletions(-) (limited to 'docs/spec/ngdocSpec.js') diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 128e0106..607745d8 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -59,10 +59,10 @@ describe('ngdoc', function() { '@param {function(number, string=)} d fn with optional arguments'); doc.parse(); expect(doc.param).toEqual([ - {name:'a', description:'

short

', type:'*', optional:false, 'default':undefined}, - {name:'b', description:'

med

', type:'Type', optional:false, 'default':undefined}, - {name:'c', description:'

long\nline

', type:'Class', optional:true, 'default':'2'}, - {name:'d', description:'

fn with optional arguments

', + {name:'a', description:'

short

\n
', type:'*', optional:false, 'default':undefined}, + {name:'b', description:'

med

\n
', type:'Type', optional:false, 'default':undefined}, + {name:'c', description:'

long\nline

\n
', type:'Class', optional:true, 'default':'2'}, + {name:'d', description:'

fn with optional arguments

\n
', type: 'function(number, string=)', optional: false, 'default':undefined} ]); }); @@ -72,7 +72,7 @@ describe('ngdoc', function() { doc.parse(); expect(doc.returns).toEqual({ type: 'Type', - description: '

text bold.

' + description: '

text bold.

\n
' }); }); @@ -142,26 +142,26 @@ describe('ngdoc', function() { '
\n' +
             '<b>angular</b>.k\n' +
             '
\n' + - ' asdf x

'); + ' asdf x

\n'); }); it('should wrap everything inside a container tag', function() { var doc = new Doc('@name superman').parse(); var content = doc.markdown('hello'); - expect(content).toMatch('

hello

'); + expect(content).toMatch('

hello

\n
'); }); it('should use the content before a colon as the name prefix for the className of the tag container', function() { var doc = new Doc('@name super: man').parse(); var content = doc.markdown('hello'); - expect(content).toMatch('

hello

'); + expect(content).toMatch('

hello

\n
'); }); it('should replace text between two
 tags', function() {
       expect(new Doc().markdown('
x
\n# One\n
b
')). - toMatch('\n\n

One

\n\n\n

One

\n\n' + + 'before\n
\n' + '
' + - '\ngit bla bla\n\n' + - '')).toEqual( + '\ngit bla bla\n
\n' + + '
')).toEqual( - '

before

\n' + + '

before

\n
\n' + '
\n' + 'git bla bla\n' + - '\n' + - '

'); + '
\n' + + '
'); }); it('should unindent text before processing based on the second line', function() { @@ -190,10 +190,10 @@ describe('ngdoc', function() { ' fourth line\n\n' + ' fifth line')). toMatch('

first line\n' + - 'second line

\n\n' + + 'second line

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

fifth line

'); + ' fourth line\n' + + '

fifth line

\n'); }); it('should unindent text before processing based on the first line', function() { @@ -202,11 +202,11 @@ describe('ngdoc', function() { ' third line\n' + ' fourth line\n\n' + ' fifth line')). - toMatch('

first line

\n\n' + + toMatch('

first line

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

fifth line

'); + ' fourth line\n' + + '

fifth line

\n
'); }); @@ -304,7 +304,7 @@ describe('ngdoc', function() { name : 'number', optional: false, 'default' : undefined, - description : '

Number \nto format.

' }]); + description : '

Number \nto format.

\n
' }]); }); it('should parse with default and optional', function() { @@ -315,7 +315,7 @@ describe('ngdoc', function() { name : 'fractionSize', optional: true, 'default' : '2', - description : '

desc

' }]); + description : '

desc

\n
' }]); }); }); @@ -325,8 +325,8 @@ describe('ngdoc', function() { doc.ngdoc = 'service'; doc.parse(); expect(doc.requires).toEqual([ - {name:'$service', text:'

for \nA

'}, - {name:'$another', text:'

for B

'}]); + {name:'$service', text:'

for \nA

\n
'}, + {name:'$another', text:'

for B

\n
'}]); expect(doc.html()).toContain('$service'); expect(doc.html()).toContain('$another'); expect(doc.html()).toContain('

for \nA

'); @@ -378,7 +378,7 @@ describe('ngdoc', function() { var doc = new Doc("@name a\n@property {string} name desc rip tion"); doc.parse(); expect(doc.properties[0].name).toEqual('name'); - expect(doc.properties[0].description).toEqual('

desc rip tion

'); + expect(doc.properties[0].description).toEqual('

desc rip tion

\n
'); }); it('should parse @property with type and description both', function() { @@ -386,7 +386,7 @@ describe('ngdoc', function() { doc.parse(); expect(doc.properties[0].name).toEqual('name'); expect(doc.properties[0].type).toEqual('bool'); - expect(doc.properties[0].description).toEqual('

desc rip tion

'); + expect(doc.properties[0].description).toEqual('

desc rip tion

\n
'); }); }); @@ -409,26 +409,26 @@ describe('ngdoc', function() { it('should parse @returns with type and description', function() { var doc = new Doc("@name a\n@returns {string} descrip tion"); doc.parse(); - expect(doc.returns).toEqual({type: 'string', description: '

descrip tion

'}); + expect(doc.returns).toEqual({type: 'string', description: '

descrip tion

\n
'}); }); it('should parse @returns with complex type and description', function() { var doc = new Doc("@name a\n@returns {function(string, number=)} description"); doc.parse(); - expect(doc.returns).toEqual({type: 'function(string, number=)', description: '

description

'}); + expect(doc.returns).toEqual({type: 'function(string, number=)', description: '

description

\n
'}); }); it('should transform description of @returns with markdown', function() { var doc = new Doc("@name a\n@returns {string} descrip *tion*"); doc.parse(); - expect(doc.returns).toEqual({type: 'string', description: '

descrip tion

'}); + expect(doc.returns).toEqual({type: 'string', description: '

descrip tion

\n
'}); }); it('should support multiline content', function() { var doc = new Doc("@name a\n@returns {string} description\n new line\n another line"); doc.parse(); expect(doc.returns). - toEqual({type: 'string', description: '

description\nnew line\nanother line

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

description\nnew line\nanother line

\n
'}); }); }); @@ -437,7 +437,7 @@ describe('ngdoc', function() { var doc = new Doc("@name a\n@description
abc
"); doc.parse(); expect(doc.description). - toBe('
<b>abc</b>
'); + toBe('
<b>abc</b>
\n
'); }); it('should support multiple pre blocks', function() { @@ -445,11 +445,10 @@ describe('ngdoc', function() { doc.parse(); expect(doc.description). toBe('

foo \n' + - '

abc
\n\n' + - '

bah

\n\n' + + '
abc
\n' + + '

bah

\n' + '

foo \n' + - '

cba
'); - + '
cba
\n
'); }); it('should support nested @link annotations with or without description', function() { @@ -491,7 +490,7 @@ describe('ngdoc', function() { it('should not remove {{}}', function() { var doc = new Doc('@name a\n@example text {{ abc }}'); doc.parse(); - expect(doc.example).toEqual('

text {{ abc }}

'); + expect(doc.example).toEqual('

text {{ abc }}

\n
'); }); }); @@ -511,11 +510,11 @@ describe('ngdoc', function() { expect(doc.html()).toContain('

Method\'s this

\n' + '
' + '
' + - '

I am self.

' + + '

I am self.

\n' + '
' + '
\n'); expect(doc.html()).toContain('

Method\'s this

\n' + - '

I am self.

'); + '

I am self.

\n
'); }); }); @@ -542,7 +541,7 @@ describe('ngdoc', function() { var doc = new Doc('@ngdoc overview\n@name angular\n@description\n#heading\ntext'); doc.parse(); expect(doc.html()).toContain('text'); - expect(doc.html()).toContain('

heading

'); + expect(doc.html()).toContain('

heading

'); expect(doc.html()).not.toContain('Description'); }); }); -- cgit v1.2.3