File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed 
src/resources/extensions/quarto/placeholder Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,24 @@ return {
1313    local  svg64  =  " data:image/svg+xml;base64,"  ..  quarto .base64 .encode (svg )
1414    local  result 
1515
16-     if  kwargs [" format"  ] ==  " svg"  then 
16+     local  output_format  =  pandoc .utils .stringify (kwargs [" format"  ])
17+     if  output_format  ==  " "  then 
18+       if  quarto .format .is_typst_output () then 
19+         output_format  =  " svg" 
20+       else  
21+         output_format  =  " png" 
22+       end 
23+     end 
24+ 
25+     if  output_format  ==  " svg"  then 
1726      result  =  svg64 
1827    else 
1928      local  mt , contents  =  pandoc .mediabag .fetch (" https://svg2png.deno.dev/"  ..  svg64 )
29+       if  mt  ~=  " image/png"  then 
30+         error (" Expected image/png but got "  ..  mt )
31+         error (contents )
32+         return  pandoc .Str (" Error rendering placeholder"  )
33+       end 
2034      result  =  " data:"  ..  mt  ..  " ;base64,"  ..  quarto .base64 .encode (contents )
2135    end 
2236
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments