File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ var block = {
3333 def : / ^ { 0 , 3 } \[ ( l a b e l ) \] : * \n ? * < ? ( [ ^ \s > ] + ) > ? (?: (?: + \n ? * | * \n * ) ( t i t l e ) ) ? * (?: \n + | $ ) / ,
3434 table : noop ,
3535 lheading : / ^ ( [ ^ \n ] + ) \n * ( = | - ) { 2 , } * (?: \n + | $ ) / ,
36- paragraph : / ^ ( [ ^ \n ] + (?: \n (? ! h r | h e a d i n g | l h e a d i n g | { 0 , 3 } > | < \/ ? (?: t a g ) (?: + | \\ n | \/ ? > ) | < (?: s c r i p t | p r e | s t y l e | ! - - ) ) [ ^ \n ] + ) + ) / ,
36+ paragraph : / ^ ( [ ^ \n ] + (?: \n ? (? ! h r | h e a d i n g | l h e a d i n g | { 0 , 3 } > | < \/ ? (?: t a g ) (?: + | \\ n | \/ ? > ) | < (?: s c r i p t | p r e | s t y l e | ! - - ) ) [ ^ \n ] + ) + ) / ,
3737 text : / ^ [ ^ \n ] + /
3838} ;
3939
Original file line number Diff line number Diff line change 11var marked = require ( '../../lib/marked.js' ) ;
22
3- it ( 'should run the test' , function ( ) {
4- spyOn ( marked , 'parse' ) . and . callThrough ( ) ;
5- marked . parse ( 'Hello World!' ) ;
6- expect ( marked . parse ) . toHaveBeenCalled ( ) ;
7- } ) ;
8-
93describe ( 'Test heading ID functionality' , function ( ) {
104 it ( 'should add id attribute by default' , function ( ) {
115 var renderer = new marked . Renderer ( marked . defaults ) ;
@@ -19,3 +13,15 @@ describe('Test heading ID functionality', function() {
1913 expect ( header ) . toBe ( '<h1>test</h1>\n' ) ;
2014 } ) ;
2115} ) ;
16+
17+ describe ( 'Test paragraph token type' , function ( ) {
18+ it ( 'should use the "paragraph" type on top level' , function ( ) {
19+ const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n' ;
20+
21+ const tokens = marked . lexer ( md ) ;
22+
23+ expect ( tokens [ 0 ] . type ) . toBe ( 'paragraph' ) ;
24+ expect ( tokens [ 3 ] . type ) . toBe ( 'paragraph' ) ;
25+ expect ( tokens [ 7 ] . type ) . toBe ( 'text' ) ;
26+ } ) ;
27+ } ) ;
You can’t perform that action at this time.
0 commit comments