File tree Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ export async function breakQuartoMd(
7676 mappedChunks ,
7777 fileName ,
7878 ) ;
79-
8079 const makeCellType = ( ) => {
8180 if ( cell_type === "code" ) {
8281 return { language } ;
@@ -148,13 +147,7 @@ export async function breakQuartoMd(
148147 // directives only carry tag source in sourceVerbatim, analogously to code
149148 cell . source = mappedString ( src , mappedChunks . slice ( 1 , - 1 ) , fileName ) ;
150149 }
151- // if the source is empty then don't add it
152- if (
153- mdTrimEmptyLines ( lines ( cell . sourceVerbatim . value ) ) . length > 0 ||
154- cell . options !== undefined
155- ) {
156- nb . cells . push ( cell ) ;
157- }
150+ nb . cells . push ( cell ) ;
158151
159152 lineBuffer . splice ( 0 , lineBuffer . length ) ;
160153 }
@@ -254,27 +247,3 @@ export async function breakQuartoMd(
254247
255248 return nb ;
256249}
257-
258- function mdTrimEmptyLines ( lines : string [ ] ) {
259- // trim leading lines
260- const firstNonEmpty = lines . findIndex ( ( line ) => line . trim ( ) . length > 0 ) ;
261- if ( firstNonEmpty === - 1 ) {
262- return [ ] ;
263- }
264- lines = lines . slice ( firstNonEmpty ) ;
265-
266- // trim trailing lines
267- let lastNonEmpty = - 1 ;
268- for ( let i = lines . length - 1 ; i >= 0 ; i -- ) {
269- if ( lines [ i ] . trim ( ) . length > 0 ) {
270- lastNonEmpty = i ;
271- break ;
272- }
273- }
274-
275- if ( lastNonEmpty > - 1 ) {
276- lines = lines . slice ( 0 , lastNonEmpty + 1 ) ;
277- }
278-
279- return lines ;
280- }
You can’t perform that action at this time.
0 commit comments