File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -144,4 +144,41 @@ levels:
144144 } ;
145145 expect ( result . levels [ 0 ] . summary ) . toMatch ( / \. \. \. $ / ) ;
146146 } ) ;
147+
148+ it ( "should match line breaks with double line breaks for proper spacing" , ( ) => {
149+ const md = `# Title
150+
151+ Description.
152+
153+ Second description line
154+
155+ ## L1 Titles
156+
157+ First line
158+
159+ Second line
160+
161+ Third line
162+ ` ;
163+
164+ const yaml = `version: "0.1.0"
165+ levels:
166+ - id: L1
167+ ` ;
168+ const result = parse ( md , yaml ) ;
169+ const expected = {
170+ summary : {
171+ description : "Description.\n\nSecond description line" ,
172+ } ,
173+ levels : [
174+ {
175+ id : "L1" ,
176+ summary : "Some text that becomes the summary" ,
177+ content : "First line\n\nSecond line\n\nThird line" ,
178+ } ,
179+ ] ,
180+ } ;
181+ expect ( result . summary . description ) . toBe ( expected . summary . description ) ;
182+ expect ( result . levels [ 0 ] . content ) . toBe ( expected . levels [ 0 ] . content ) ;
183+ } ) ;
147184} ) ;
You can’t perform that action at this time.
0 commit comments