Skip to content

fix(filters): fix include-dark with meta-resolved image paths#2086

Open
mcanouil wants to merge 1 commit into
quarto-dev:mainfrom
mcanouil:fix/broken-positron-screenshot
Open

fix(filters): fix include-dark with meta-resolved image paths#2086
mcanouil wants to merge 1 commit into
quarto-dev:mainfrom
mcanouil:fix/broken-positron-screenshot

Conversation

@mcanouil

@mcanouil mcanouil commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

The Positron screenshot was broken on the Python, R, and Julia computations pages and images showed as missing.

The root cause is in how Quarto encodes shortcodes before handing the document to Pandoc. See quarto-dev/quarto-cli#14583 for details.

The filter now checks for the double-extension case (same extension appearing twice) and strips the outer spurious one before building the dark and light image paths. This makes the filter robust for any {{< meta >}} + .include-dark combination until the root cause is fixed upstream in the qmd reader. This is more a workaround than an actual fix, but it at least fix the issue in the documentation with minimal change.

Closes quarto-dev/quarto-cli#14583

Quarto adds a spurious extension when an image src is resolved via
{{< meta >}}, turning foo.png into foo.png.png. The include-dark.lua
filter then produced foo.png-dark.png (dark) and foo.png.png (light),
neither of which exists on disk.

Detect the double-extension case by checking whether the stem returned
by split_extension itself carries the same extension (e.g. foo.png has
stem foo and ext .png, then split_extension(foo) has no extension, so
no double; but foo.png.png has stem foo.png and ext .png, then
split_extension(foo.png) also returns .png — same extension twice).
Strip the outer spurious extension before generating the dark/light pair.

Closes quarto-dev/quarto-cli#14583
@mcanouil mcanouil force-pushed the fix/broken-positron-screenshot branch from 8ced107 to cf3927e Compare June 27, 2026 14:14
@mcanouil mcanouil changed the title fix(computations): fix broken Positron screenshot images fix(filters): fix include-dark with meta-resolved image paths Jun 27, 2026
@mcanouil mcanouil marked this pull request as draft June 27, 2026 14:29
@mcanouil mcanouil marked this pull request as ready for review June 27, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image missing https://quarto.org/docs/computations/python.html#positron

1 participant