File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export function fixupFrontMatter(nb: JupyterNotebook): JupyterNotebook {
114114
115115 // helper to create nb lines (w/ newline after)
116116 const nbLines = ( lns : string [ ] ) => {
117- return lns . map ( ( line ) => `${ line } \n` ) ;
117+ return lns . map ( ( line ) => line . endsWith ( "\n" ) ? line : `${ line } \n` ) ;
118118 } ;
119119
120120 // look for the first raw block that has a yaml object
@@ -137,7 +137,7 @@ export function fixupFrontMatter(nb: JupyterNotebook): JupyterNotebook {
137137 for ( const cell of nb . cells ) {
138138 if ( cell . cell_type === "markdown" ) {
139139 const { lines, headingText } = markdownWithExtractedHeading (
140- cell . source . join ( "\n " ) ,
140+ nbLines ( cell . source ) . join ( "" ) ,
141141 ) ;
142142 if ( headingText ) {
143143 title = headingText ;
You can’t perform that action at this time.
0 commit comments