fix: Typst extension logo path resolution in subdirectories (#13917)#13931
fix: Typst extension logo path resolution in subdirectories (#13917)#13931gordonwoodhull wants to merge 1 commit intomainfrom
Conversation
…13917) Extension-resolved logo paths (containing _extensions or starting with ..) are already relative to the input document and should not have the project offset applied. This fixes rendering Typst format extensions with logos when the document is in a project subdirectory. The same pattern was applied to font-paths in #13745 / PR #13902. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
FWI, the issue does not seem limited to logo, other resources are impacted. I updated my reprex: git clone --filter=blob:none --sparse https://github.com/mcanouil/quarto-issues-experiments.git
cd quarto-issues-experiments
git sparse-checkout set quarto-cli-13917Extensions resources should never have |
|
I asked the critical code reviewer for feedback on both this and #13745 and among other things it said this:
Thus my paralysis in merging either fix. We can't really make our paths typed in the current codebase, but yes that is the root cause of all these miserable path problems. I'm looking into the use of more project-relative or absolute paths as a better fix. But I won't get to it until I get back. |
Summary
_extensionsor starting with..) are already input-relative and should not haveprojectOffset()appliedProblem
When using a custom Typst format extension with a logo, rendering from a subdirectory fails:
The bug was introduced in commit
533784522which addedprojectOffset()to logo paths for brand.yml support, but incorrectly applied it to all logo paths including extension-resolved ones.Solution
In
src/resources/filters/quarto-post/typst-brand-yaml.lua, detect extension-resolved paths and skip the project offset:This is the same pattern used in PR #13902 for font-paths.
Related
plans/brand-extension-path-resolution.mdfor detailed analysis of both path systemsFixes #13917
Test plan
tests/docs/smoke-all/typst/extension-logo/verifies correct path in generated.typfile🤖 Generated with Claude Code