File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ class JupyterConverter {
104104 }
105105 return cells
106106 }
107- if ( nodeName === 'example' ) {
107+ if ( nodeName === 'example' || nodeName === 'sidebar' ) {
108108 const blocks = node . getBlocks ( )
109109 const cells = [ ]
110110 let lastCell = { }
Original file line number Diff line number Diff line change @@ -360,12 +360,32 @@ He could hear doves **cooing** in the pine trees’ branches.
360360 to_file : false
361361 } )
362362 expect ( result ) . is . not . empty ( )
363- debug ( )
364363 const ipynb = JSON . parse ( result )
365364 expect ( ipynb . cells [ 0 ] . source . join ( '' ) ) . is . equal ( `[Refcard](refcard.pdf)
366365
367366[[sect-a]](#sect-a)
368367` )
369368 await debug ( result , 'xrefs.ipynb' )
370369 } )
370+ it ( 'should convert nested blocks' , async ( ) => {
371+ const inputFile = path . join ( __dirname , 'fixtures' , 'nested-blocks.adoc' )
372+ const result = asciidoctor . convertFile ( inputFile , {
373+ safe : 'safe' ,
374+ backend : 'jupyter' ,
375+ to_file : false
376+ } )
377+ expect ( result ) . is . not . empty ( )
378+ const ipynb = JSON . parse ( result )
379+ expect ( ipynb . cells [ 0 ] . source . join ( '' ) ) . is . equal ( `# Nested Blocks
380+
381+ *Title*\\
382+ Example…​
383+
384+
385+ $$
386+ A_1=\\left(\\begin{array}{lll}
387+ $$
388+ ` )
389+ await debug ( result , 'nested-blocks.ipynb' )
390+ } )
371391} )
Original file line number Diff line number Diff line change 1+ = Nested Blocks
2+
3+ .Title
4+ [.style]
5+ ****
6+ Example...
7+ [stem]
8+ ++++
9+ A_1=\left(\begin{array}{lll}
10+ ++++
11+ ****
You can’t perform that action at this time.
0 commit comments