File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1930,11 +1930,15 @@ function mdImageOutput(
19301930 ? ( data as string [ ] ) . join ( "" )
19311931 : data as string ;
19321932
1933- // base64 decode if it's not encoded svg
1934- // when used in embed context, Pandoc will generate ipynb with base64 encoded svg data
1935- // https://github.com/quarto-dev/quarto-cli/issues/9793
19361933 const outputFile = join ( options . assets . base_dir , imageFile ) ;
1937- if ( mimeType !== kImageSvg || ! imageText . trimStart ( ) . startsWith ( "<svg" ) ) {
1934+ if (
1935+ // base64 decode if it's not svg
1936+ mimeType !== kImageSvg ||
1937+ // or if it is encoded svg; this could happen when used in embed context,
1938+ // as Pandoc will generate ipynb with base64 encoded svg data
1939+ // https://github.com/quarto-dev/quarto-cli/issues/9793
1940+ ! / < s v g / . test ( imageText )
1941+ ) {
19381942 const imageData = base64decode ( imageText ) ;
19391943
19401944 // if we are in retina mode, then derive width and height from the image
You can’t perform that action at this time.
0 commit comments