quarto-dev / quarto-dev/quarto-cli

`filters` and `shortcodes` do not respect Quarto's convention about leading `/`

Open
#12,408 2 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Mar 31, 2025.

bug lua
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

filters and shortcodes path resolution does not respect Quarto's convention about leading /.

mkdir issue
cd issue
touch -f _quarto.yml
echo 'function Pandoc(doc)\n  quarto.log.output("Hello, world!")\nend' > filter.lua
mkdir subdir

echo '---\ntitle: "Hello"\nformat: html\nfilters:\n  - at: post-quarto\n    path: /filter.lua\n---\n\n# Hello, world!' > subdir/hello.qmd
quarto render subdir/hello.qmd

echo '---\ntitle: "Hello"\nformat: html\nfilters:\n  - /filter.lua\n---\n\n# Hello, world!' > subdir/hello.qmd
quarto render subdir/hello.qmd

echo '---\ntitle: "Hello"\nformat: html\nshortcodes:\n  - /filter.lua\n---\n\n# Hello, world!' > subdir/hello.qmd
quarto render subdir/hello.qmd
ERROR (/Users/mcanouil/Projects/quarto/quarto-cli/src/resources/filters/./common/wrapped-filter.lua:200) cannot open /filter.lua: No such file or directory
ERROR: Error
    at renderFiles (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:351:23)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async renderProject (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/project.ts:463:23)
    at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/cmd.ts:251:26)
    at async Command.execute (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1780:14)
    at async quarto (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/quarto.ts:191:5)
    at async file:///Users/mcanouil/Projects/quarto/quarto-cli/src/quarto.ts:220:5
    at async file:///Users/mcanouil/Projects/quarto/quarto-cli/src/core/main.ts:41:14
    at async mainRunner (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/core/main.ts:43:5)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.