File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 4242 },
4343 "devDependencies" : {
4444 "browserify" : " ^16.0.0" ,
45+ "mdast-util-from-markdown" : " ^0.7.0" ,
4546 "nyc" : " ^15.0.0" ,
4647 "prettier" : " ^2.0.0" ,
4748 "remark-cli" : " ^8.0.0" ,
Original file line number Diff line number Diff line change 11var test = require ( 'tape' )
2+ var from = require ( 'mdast-util-from-markdown' )
23var to = require ( '.' )
34
45test ( 'mdast-util-to-markdown' , function ( t ) {
@@ -2384,3 +2385,47 @@ test('escape', function (t) {
23842385
23852386 t . end ( )
23862387} )
2388+
2389+ test ( 'roundtrip' , function ( t ) {
2390+ var doc = [
2391+ '> * Lorem ipsum dolor sit amet' ,
2392+ '>' ,
2393+ '> * consectetur adipisicing elit'
2394+ ] . join ( '\n' )
2395+
2396+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip spread items in block quotes' )
2397+
2398+ doc = [
2399+ '* Lorem ipsum dolor sit amet' ,
2400+ '' ,
2401+ ' 1. consectetur adipisicing elit' ,
2402+ '' ,
2403+ ' 2. sed do eiusmod tempor incididunt'
2404+ ] . join ( '\n' )
2405+
2406+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip spread items in sublists (1)' )
2407+
2408+ doc = [
2409+ '* 1. Lorem ipsum dolor sit amet' ,
2410+ '' ,
2411+ ' 2. consectetur adipisicing elit'
2412+ ] . join ( '\n' )
2413+
2414+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip spread items in sublists (2)' )
2415+
2416+ doc = [
2417+ '* hello' ,
2418+ ' * world' ,
2419+ ' how' ,
2420+ '' ,
2421+ ' are' ,
2422+ ' you' ,
2423+ '' ,
2424+ ' * today' ,
2425+ '* hi'
2426+ ] . join ( '\n' )
2427+
2428+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip spread items in sublists (3)' )
2429+
2430+ t . end ( )
2431+ } )
You can’t perform that action at this time.
0 commit comments