File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ var block = {
33
33
def : / ^ { 0 , 3 } \[ ( l a b e l ) \] : * \n ? * < ? ( [ ^ \s > ] + ) > ? (?: (?: + \n ? * | * \n * ) ( t i t l e ) ) ? * (?: \n + | $ ) / ,
34
34
table : noop ,
35
35
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 ] + ) + ) / ,
37
37
text : / ^ [ ^ \n ] + /
38
38
} ;
39
39
Original file line number Diff line number Diff line change 1
1
var marked = require ( '../../lib/marked.js' ) ;
2
2
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
-
9
3
describe ( 'Test heading ID functionality' , function ( ) {
10
4
it ( 'should add id attribute by default' , function ( ) {
11
5
var renderer = new marked . Renderer ( marked . defaults ) ;
@@ -19,3 +13,15 @@ describe('Test heading ID functionality', function() {
19
13
expect ( header ) . toBe ( '<h1>test</h1>\n' ) ;
20
14
} ) ;
21
15
} ) ;
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