Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mcanouil opened this issue Mar 29, 2025 · 2 comments · May be fixed by #12494
Open

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

mcanouil opened this issue Mar 29, 2025 · 2 comments · May be fixed by #12494
Assignees
Labels
bug Something isn't working lua Issues related to the lua codebase, filter chain, etc
Milestone

Comments

@mcanouil
Copy link
Collaborator

mcanouil commented Mar 29, 2025

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/[email protected]/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/[email protected]/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)
@mcanouil mcanouil added bug Something isn't working lua Issues related to the lua codebase, filter chain, etc labels Mar 29, 2025
@mcanouil
Copy link
Collaborator Author

@mcanouil mcanouil changed the title filters do not respect Quarto's convention about leading / filters and shortcodes do not respect Quarto's convention about leading / Mar 29, 2025
@cscheid cscheid self-assigned this Mar 31, 2025
@cscheid cscheid added this to the v1.8 milestone Mar 31, 2025
@cscheid cscheid modified the milestones: v1.8, v1.7 Apr 8, 2025
@cscheid cscheid linked a pull request Apr 8, 2025 that will close this issue
@cscheid cscheid modified the milestones: v1.7, v1.8 Apr 8, 2025
@cscheid
Copy link
Collaborator

cscheid commented Apr 8, 2025

Wowee, what a mess. I'm not merging this against a RC...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lua Issues related to the lua codebase, filter chain, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants