@@ -59,10 +59,10 @@ describe('ngdoc', function() {
5959 '@param {function(number, string=)} d fn with optional arguments' ) ;
6060 doc . parse ( ) ;
6161 expect ( doc . param ) . toEqual ( [
62- { name :'a' , description :'<div class="a-page"><p>short</p></div>' , type :'*' , optional :false , 'default' :undefined } ,
63- { name :'b' , description :'<div class="a-page"><p>med</p></div>' , type :'Type' , optional :false , 'default' :undefined } ,
64- { name :'c' , description :'<div class="a-page"><p>long\nline</p></div>' , type :'Class' , optional :true , 'default' :'2' } ,
65- { name :'d' , description :'<div class="a-page"><p>fn with optional arguments</p></div>' ,
62+ { name :'a' , description :'<div class="a-page"><p>short</p>\n </div>' , type :'*' , optional :false , 'default' :undefined } ,
63+ { name :'b' , description :'<div class="a-page"><p>med</p>\n </div>' , type :'Type' , optional :false , 'default' :undefined } ,
64+ { name :'c' , description :'<div class="a-page"><p>long\nline</p>\n </div>' , type :'Class' , optional :true , 'default' :'2' } ,
65+ { name :'d' , description :'<div class="a-page"><p>fn with optional arguments</p>\n </div>' ,
6666 type : 'function(number, string=)' , optional : false , 'default' :undefined }
6767 ] ) ;
6868 } ) ;
@@ -72,7 +72,7 @@ describe('ngdoc', function() {
7272 doc . parse ( ) ;
7373 expect ( doc . returns ) . toEqual ( {
7474 type : 'Type' ,
75- description : '<div class="a-page"><p>text <em>bold</em>.</p></div>'
75+ description : '<div class="a-page"><p>text <em>bold</em>.</p>\n </div>'
7676 } ) ;
7777 } ) ;
7878
@@ -142,26 +142,26 @@ describe('ngdoc', function() {
142142 '<pre class="prettyprint linenums">\n' +
143143 '<b>angular</b>.k\n' +
144144 '</pre>\n' +
145- ' asdf x</p></div>' ) ;
145+ ' asdf x</p>\n </div>' ) ;
146146 } ) ;
147147
148148 it ( 'should wrap everything inside a container tag' , function ( ) {
149149 var doc = new Doc ( '@name superman' ) . parse ( ) ;
150150 var content = doc . markdown ( 'hello' ) ;
151151
152- expect ( content ) . toMatch ( '<div class="superman-page"><p>hello</p></div>' ) ;
152+ expect ( content ) . toMatch ( '<div class="superman-page"><p>hello</p>\n </div>' ) ;
153153 } ) ;
154154
155155 it ( 'should use the content before a colon as the name prefix for the className of the tag container' , function ( ) {
156156 var doc = new Doc ( '@name super: man' ) . parse ( ) ;
157157 var content = doc . markdown ( 'hello' ) ;
158158
159- expect ( content ) . toMatch ( '<div class="super-page super-man-page"><p>hello</p></div>' ) ;
159+ expect ( content ) . toMatch ( '<div class="super-page super-man-page"><p>hello</p>\n </div>' ) ;
160160 } ) ;
161161
162162 it ( 'should replace text between two <pre></pre> tags' , function ( ) {
163163 expect ( new Doc ( ) . markdown ( '<pre>x</pre>\n# One\n<pre>b</pre>' ) ) .
164- toMatch ( '</pre>\n\n <h1 id="one" >One</h1>\n \n<pre' ) ;
164+ toMatch ( '</pre>\n<h1>One</h1>\n<pre' ) ;
165165 } ) ;
166166
167167 it ( 'should replace inline variable type hints' , function ( ) {
@@ -171,16 +171,16 @@ describe('ngdoc', function() {
171171
172172 it ( 'should ignore nested doc widgets' , function ( ) {
173173 expect ( new Doc ( ) . markdown (
174- 'before<div class="tabbable">\n' +
174+ 'before\n <div class="tabbable">\n' +
175175 '<div class="tab-pane well" id="git-mac" ng:model="Git on Mac/Linux">' +
176- '\ngit bla bla\n</doc:tutorial-instruction >\n' +
177- '</doc:tutorial-instructions >' ) ) . toEqual (
176+ '\ngit bla bla\n</div >\n' +
177+ '</div >' ) ) . toEqual (
178178
179- '<div class="docs-page"><p>before<div class="tabbable">\n' +
179+ '<div class="docs-page"><p>before</p>\n< div class="tabbable">\n' +
180180 '<div class="tab-pane well" id="git-mac" ng:model="Git on Mac/Linux">\n' +
181181 'git bla bla\n' +
182- '</doc:tutorial-instruction >\n' +
183- '</doc:tutorial-instructions></p ></div>' ) ;
182+ '</div >\n' +
183+ '</div ></div>' ) ;
184184 } ) ;
185185
186186 it ( 'should unindent text before processing based on the second line' , function ( ) {
@@ -190,10 +190,10 @@ describe('ngdoc', function() {
190190 ' fourth line\n\n' +
191191 ' fifth line' ) ) .
192192 toMatch ( '<p>first line\n' +
193- 'second line</p>\n\n ' +
193+ 'second line</p>\n' +
194194 '<pre><code>third line\n' +
195- ' fourth line\n </code></pre>\n \n' +
196- '<p>fifth line</p>' ) ;
195+ ' fourth line</code></pre>\n' +
196+ '<p>fifth line</p>\n ' ) ;
197197 } ) ;
198198
199199 it ( 'should unindent text before processing based on the first line' , function ( ) {
@@ -202,11 +202,11 @@ describe('ngdoc', function() {
202202 ' third line\n' +
203203 ' fourth line\n\n' +
204204 ' fifth line' ) ) .
205- toMatch ( '<p>first line</p>\n \n' +
205+ toMatch ( '<div class="docs-page">< p>first line</p>\n' +
206206 '<pre><code>second line\n' +
207207 'third line\n' +
208- ' fourth line\n </code></pre>\n \n' +
209- '<p>fifth line</p>' ) ;
208+ ' fourth line</code></pre>\n' +
209+ '<p>fifth line</p>\n</div> ' ) ;
210210 } ) ;
211211
212212
@@ -304,7 +304,7 @@ describe('ngdoc', function() {
304304 name : 'number' ,
305305 optional : false ,
306306 'default' : undefined ,
307- description : '<div class="a-page"><p>Number \nto format.</p></div>' } ] ) ;
307+ description : '<div class="a-page"><p>Number \nto format.</p>\n </div>' } ] ) ;
308308 } ) ;
309309
310310 it ( 'should parse with default and optional' , function ( ) {
@@ -315,7 +315,7 @@ describe('ngdoc', function() {
315315 name : 'fractionSize' ,
316316 optional : true ,
317317 'default' : '2' ,
318- description : '<div class="a-page"><p>desc</p></div>' } ] ) ;
318+ description : '<div class="a-page"><p>desc</p>\n </div>' } ] ) ;
319319 } ) ;
320320 } ) ;
321321
@@ -325,8 +325,8 @@ describe('ngdoc', function() {
325325 doc . ngdoc = 'service' ;
326326 doc . parse ( ) ;
327327 expect ( doc . requires ) . toEqual ( [
328- { name :'$service' , text :'<div class="a-page"><p>for \n<code>A</code></p></div>' } ,
329- { name :'$another' , text :'<div class="a-page"><p>for <code>B</code></p></div>' } ] ) ;
328+ { name :'$service' , text :'<div class="a-page"><p>for \n<code>A</code></p>\n </div>' } ,
329+ { name :'$another' , text :'<div class="a-page"><p>for <code>B</code></p>\n </div>' } ] ) ;
330330 expect ( doc . html ( ) ) . toContain ( '<a href="api/ng.$service">$service</a>' ) ;
331331 expect ( doc . html ( ) ) . toContain ( '<a href="api/ng.$another">$another</a>' ) ;
332332 expect ( doc . html ( ) ) . toContain ( '<p>for \n<code>A</code></p>' ) ;
@@ -378,15 +378,15 @@ describe('ngdoc', function() {
378378 var doc = new Doc ( "@name a\n@property {string} name desc rip tion" ) ;
379379 doc . parse ( ) ;
380380 expect ( doc . properties [ 0 ] . name ) . toEqual ( 'name' ) ;
381- expect ( doc . properties [ 0 ] . description ) . toEqual ( '<div class="a-page"><p>desc rip tion</p></div>' ) ;
381+ expect ( doc . properties [ 0 ] . description ) . toEqual ( '<div class="a-page"><p>desc rip tion</p>\n </div>' ) ;
382382 } ) ;
383383
384384 it ( 'should parse @property with type and description both' , function ( ) {
385385 var doc = new Doc ( "@name a\n@property {bool} name desc rip tion" ) ;
386386 doc . parse ( ) ;
387387 expect ( doc . properties [ 0 ] . name ) . toEqual ( 'name' ) ;
388388 expect ( doc . properties [ 0 ] . type ) . toEqual ( 'bool' ) ;
389- expect ( doc . properties [ 0 ] . description ) . toEqual ( '<div class="a-page"><p>desc rip tion</p></div>' ) ;
389+ expect ( doc . properties [ 0 ] . description ) . toEqual ( '<div class="a-page"><p>desc rip tion</p>\n </div>' ) ;
390390 } ) ;
391391
392392 } ) ;
@@ -409,26 +409,26 @@ describe('ngdoc', function() {
409409 it ( 'should parse @returns with type and description' , function ( ) {
410410 var doc = new Doc ( "@name a\n@returns {string} descrip tion" ) ;
411411 doc . parse ( ) ;
412- expect ( doc . returns ) . toEqual ( { type : 'string' , description : '<div class="a-page"><p>descrip tion</p></div>' } ) ;
412+ expect ( doc . returns ) . toEqual ( { type : 'string' , description : '<div class="a-page"><p>descrip tion</p>\n </div>' } ) ;
413413 } ) ;
414414
415415 it ( 'should parse @returns with complex type and description' , function ( ) {
416416 var doc = new Doc ( "@name a\n@returns {function(string, number=)} description" ) ;
417417 doc . parse ( ) ;
418- expect ( doc . returns ) . toEqual ( { type : 'function(string, number=)' , description : '<div class="a-page"><p>description</p></div>' } ) ;
418+ expect ( doc . returns ) . toEqual ( { type : 'function(string, number=)' , description : '<div class="a-page"><p>description</p>\n </div>' } ) ;
419419 } ) ;
420420
421421 it ( 'should transform description of @returns with markdown' , function ( ) {
422422 var doc = new Doc ( "@name a\n@returns {string} descrip *tion*" ) ;
423423 doc . parse ( ) ;
424- expect ( doc . returns ) . toEqual ( { type : 'string' , description : '<div class="a-page"><p>descrip <em>tion</em></p></div>' } ) ;
424+ expect ( doc . returns ) . toEqual ( { type : 'string' , description : '<div class="a-page"><p>descrip <em>tion</em></p>\n </div>' } ) ;
425425 } ) ;
426426
427427 it ( 'should support multiline content' , function ( ) {
428428 var doc = new Doc ( "@name a\n@returns {string} description\n new line\n another line" ) ;
429429 doc . parse ( ) ;
430430 expect ( doc . returns ) .
431- toEqual ( { type : 'string' , description : '<div class="a-page"><p>description\nnew line\nanother line</p></div>' } ) ;
431+ toEqual ( { type : 'string' , description : '<div class="a-page"><p>description\nnew line\nanother line</p>\n </div>' } ) ;
432432 } ) ;
433433 } ) ;
434434
@@ -437,19 +437,18 @@ describe('ngdoc', function() {
437437 var doc = new Doc ( "@name a\n@description <pre><b>abc</b></pre>" ) ;
438438 doc . parse ( ) ;
439439 expect ( doc . description ) .
440- toBe ( '<div class="a-page"><pre class="prettyprint linenums"><b>abc</b></pre></div>' ) ;
440+ toBe ( '<div class="a-page"><pre class="prettyprint linenums"><b>abc</b></pre>\n </div>' ) ;
441441 } ) ;
442442
443443 it ( 'should support multiple pre blocks' , function ( ) {
444444 var doc = new Doc ( "@name a\n@description foo \n<pre>abc</pre>\n#bah\nfoo \n<pre>cba</pre>" ) ;
445445 doc . parse ( ) ;
446446 expect ( doc . description ) .
447447 toBe ( '<div class="a-page"><p>foo \n' +
448- '<pre class="prettyprint linenums">abc</pre>\n\n ' +
449- '<h1 id="bah" >bah</h1>\n \n' +
448+ '<pre class="prettyprint linenums">abc</pre>\n' +
449+ '<h1>bah</h1>\n' +
450450 '<p>foo \n' +
451- '<pre class="prettyprint linenums">cba</pre></div>' ) ;
452-
451+ '<pre class="prettyprint linenums">cba</pre>\n</div>' ) ;
453452 } ) ;
454453
455454 it ( 'should support nested @link annotations with or without description' , function ( ) {
@@ -491,7 +490,7 @@ describe('ngdoc', function() {
491490 it ( 'should not remove {{}}' , function ( ) {
492491 var doc = new Doc ( '@name a\n@example text {{ abc }}' ) ;
493492 doc . parse ( ) ;
494- expect ( doc . example ) . toEqual ( '<div class="a-page"><p>text {{ abc }}</p></div>' ) ;
493+ expect ( doc . example ) . toEqual ( '<div class="a-page"><p>text {{ abc }}</p>\n </div>' ) ;
495494 } ) ;
496495 } ) ;
497496
@@ -511,11 +510,11 @@ describe('ngdoc', function() {
511510 expect ( doc . html ( ) ) . toContain ( '<h3>Method\'s <code>this</code></h3>\n' +
512511 '<div>' +
513512 '<div class="a-page">' +
514- '<p>I am self.</p>' +
513+ '<p>I am self.</p>\n ' +
515514 '</div>' +
516515 '</div>\n' ) ;
517516 expect ( doc . html ( ) ) . toContain ( '<h3>Method\'s <code>this</code></h3>\n' +
518- '<div><div class="a-page"><p>I am self.</p></div></div>' ) ;
517+ '<div><div class="a-page"><p>I am self.</p>\n </div></div>' ) ;
519518 } ) ;
520519 } ) ;
521520
@@ -542,7 +541,7 @@ describe('ngdoc', function() {
542541 var doc = new Doc ( '@ngdoc overview\n@name angular\n@description\n#heading\ntext' ) ;
543542 doc . parse ( ) ;
544543 expect ( doc . html ( ) ) . toContain ( 'text' ) ;
545- expect ( doc . html ( ) ) . toContain ( '<h2 id="heading" >heading</h2>' ) ;
544+ expect ( doc . html ( ) ) . toContain ( '<h2>heading</h2>' ) ;
546545 expect ( doc . html ( ) ) . not . toContain ( 'Description' ) ;
547546 } ) ;
548547 } ) ;
0 commit comments