File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/resources/filters/quarto-post Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,16 @@ function pdfImages()
3333 -- If the src is pointing to a local file that is an svg, process it
3434 local ext = select (2 , pandoc .path .split_extension (image .src ))
3535 if ext == ' .svg' then
36- local converted = convert_svg (image .src )
37- if converted then
38- image .src = converted
36+ local convertedPath = convert_svg (image .src )
37+ if convertedPath then
38+ local contents = _quarto .file .read (convertedPath )
39+ local relativePath = pandoc .path .make_relative (convertedPath , ' .' )
40+
41+ -- add to media bag and remove the converted file
42+ pandoc .mediabag .insert (relativePath , ' application/pdf' , contents )
43+ _quarto .file .remove (relativePath )
44+
45+ image .src = relativePath
3946 return image
4047 end
4148 end
You can’t perform that action at this time.
0 commit comments