Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ All changes included in 1.9:
- Two-column layout now uses `set page(columns:)` instead of `columns()` function, fixing compatibility with landscape sections.
- Title block now properly spans both columns in multi-column layouts.
- ([#13870](https://github.com/quarto-dev/quarto-cli/issues/13870)): Add support for `alt` attribute on cross-referenced equations for improved accessibility. (author: @mcanouil)
- ([#13917](https://github.com/quarto-dev/quarto-cli/issues/13917)): Fix resource path resolution for Typst format extensions when document is in a project subdirectory. Extension-resolved paths are now correctly detected and not double-prefixed with the project offset.

### `pdf`

Expand Down
12 changes: 10 additions & 2 deletions src/resources/filters/quarto-post/typst-brand-yaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,17 @@ function render_typst_brand_yaml()
imageFilename = imageFilename and imageFilename:gsub('\\_', '_')
else
-- backslashes need to be doubled for Windows
-- Only apply project offset for brand logo paths (project-relative).
-- Extension-resolved paths (containing _extensions or starting with ..)
-- are already input-relative and should not have the offset applied.
-- See #13745 for the same pattern applied to font-paths.
if imageFilename[1] ~= "/" and _quarto.projectOffset() ~= "." then
local offset = _quarto.projectOffset()
imageFilename = pandoc.path.join({offset, imageFilename})
local is_extension_path = string.find(imageFilename, "_extensions") or
string.sub(imageFilename, 1, 2) == ".."
if not is_extension_path then
local offset = _quarto.projectOffset()
imageFilename = pandoc.path.join({offset, imageFilename})
end
end
imageFilename = string.gsub(imageFilename, '\\', '\\\\')
end
Expand Down
2 changes: 2 additions & 0 deletions tests/docs/smoke-all/typst/extension-logo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
**/*.quarto_ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Issue Extension
author: Test
version: "1.0.0"
quarto-required: ">=1.3.0"
contributes:
formats:
typst:
logo: quarto-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions tests/docs/smoke-all/typst/extension-logo/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project:
title: "Extension Logo Test"
14 changes: 14 additions & 0 deletions tests/docs/smoke-all/typst/extension-logo/sub/template.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Extension Logo Test"
format: issue-typst
_quarto:
tests:
typst:
ensureTypstFileRegexMatches:
-
- 'image\("\.\./(_extensions|_extensions)(/|\\\\)issue(/|\\\\)quarto-icon\.svg"'
-
- 'image\("\.\./\.\./(_extensions|_extensions)'
---

This is a test document that uses a Typst format extension with a logo.
Loading