Skip to content

Fix juice failing on Windows when Quarto path contains spaces#14207

Merged
cderv merged 2 commits intomainfrom
fix/issue-14202
Mar 13, 2026
Merged

Fix juice failing on Windows when Quarto path contains spaces#14207
cderv merged 2 commits intomainfrom
fix/issue-14202

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Mar 13, 2026

When Quarto is installed in a path with spaces (e.g., C:\Program Files\Quarto\), rendering gt tables to Typst fails with Running juice failed with exit code: 1, preceded by 'C:\Program' is not recognized as an internal or external command.

Root Cause

The juice() function in astpipeline.lua uses io.popen() with string concatenation to build the command. When quarto.config.cli_path() returns a path with spaces, the shell splits it at the space boundary — C:\Program is treated as the executable and Files\... as a separate argument.

Fix

Replace io.popen() with pandoc.pipe(), which calls the executable directly with arguments as an array. No shell interpretation occurs, so spaces in any path component are handled correctly.

This matches the existing pattern used in shiny.lua and pdf-images.lua for external command execution.

Verification

Tested by unzipping Quarto v1.9.33 prerelease into C:\Users\chris\Quarto Test Space\, patching the bundled main.lua with the same change, and rendering a gt table to Typst — the error no longer occurs. All existing juice-related smoke-all tests pass without regression:

  • typst/juice/test.qmd
  • typst/juice/gt-table-images.qmd
  • typst/css-property-processing/default.qmd
  • typst/css-property-processing/translate.qmd
  • typst/css-property-processing/none.qmd

Fixes #14202

Replace io.popen() with pandoc.pipe() in juice() to avoid shell
word-splitting when the Quarto install path contains spaces
(e.g., C:\Program Files\Quarto\).

io.popen() concatenates the command as a string passed to the shell,
which breaks at spaces. pandoc.pipe() calls the executable directly
with arguments as an array, bypassing shell interpretation entirely.

Fixes #14202
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Mar 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv merged commit c02ef92 into main Mar 13, 2026
52 of 53 checks passed
@cderv cderv deleted the fix/issue-14202 branch March 13, 2026 14:02
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.

"Running juice failed" when rendering gt tables to Typst format on Windows

2 participants