diff --git a/news/changelog-1.5.md b/news/changelog-1.5.md index 5396f802b3..63f7584dc3 100644 --- a/news/changelog-1.5.md +++ b/news/changelog-1.5.md @@ -104,7 +104,7 @@ All changes included in 1.5: - ([#8939](https://github.com/quarto-dev/quarto-cli/pull/8939)): `quarto inspect` now takes an additional optional parameter to specify the output file, and provides the graph of include dependencies for the inspection target. -## Other Fixes +## Other Fixes and Improvements - ([#8119](https://github.com/quarto-dev/quarto-cli/issues/8119)): More intelligently detect when ejs templates are modified during development, improving quality of life during preview. - ([#8177](https://github.com/quarto-dev/quarto-cli/issues/8177)): Use an explicit path to `sysctl` when detecting MacOS architecture. (author: @kevinushey) @@ -121,5 +121,6 @@ All changes included in 1.5: - ([#8937](https://github.com/quarto-dev/quarto-cli/issues/8937)): Fix unix launcher script to properly handle spaces in the path to the quarto executable. - ([#8898](https://github.com/quarto-dev/quarto-cli/issues/8898)): `.deb` and `.tar.gz` bundle contents are now associated to root user and group instead of default user and group for CI build runners. - Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Specify a specific number of paragraphs (`{{< lipsum 3 >}}`). +- Resolve data URIs in Pandoc's mediabag when rendering documents. - Increase v8's max heap size by default, to avoid out-of-memory errors when rendering large documents (also cf. https://github.com/denoland/deno/issues/18935). - Upgrade Deno to 1.41.0 diff --git a/src/resources/filters/quarto-post/pdf-images.lua b/src/resources/filters/quarto-post/pdf-images.lua index 453379a1c9..87491f35a9 100644 --- a/src/resources/filters/quarto-post/pdf-images.lua +++ b/src/resources/filters/quarto-post/pdf-images.lua @@ -76,6 +76,7 @@ function pdfImages() -- See if the path points to an SVG in the media bag -- (been generated by a filter, for example) return mediabag.with_mediabag_contents(image.src, function (mime_type, tempPath) + print(mime_type, tempPath) if mime_type == 'image/svg+xml' then local convertedPath = call_rsvg_convert(tempPath) if convertedPath == nil then @@ -101,7 +102,9 @@ function pdfImages() image.src = mediabag.resolved_url_cache[image.src] return image end - local relativePath = image.src:match("https?://[%w%$%-%_%.%+%!%*%'%(%)%:%%]+/(.+)") + + local relativePath = image.src:match("https?://[%w%$%-%_%.%+%!%*%'%(%)%:%%]+/(.+)") or + image.src:match("data:image/.+;base64,(.+)") if not (relativePath or param("has-resource-path", false)) then return nil end