Skip to content

Commit ee5a93c

Browse files
double backslash windows paths
1 parent 05057b9 commit ee5a93c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/resources/filters/quarto-post/typst-brand-yaml.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ function render_typst_brand_yaml()
250250
location_to_typst_align(logoOptions.location) or 'left+top'
251251
quarto.log.debug('logo options', logoOptions)
252252
local altProp = logoOptions.alt and (', alt: "' .. logoOptions.alt .. '"') or ''
253+
local dblbackslash = string.gsub(logoOptions.path, '\\', '\\\\') -- double backslash?
253254
quarto.doc.include_text('in-header',
254-
'#set page(background: align(' .. logoOptions.location .. ', box(inset: ' .. logoOptions.padding .. ', image("' .. logoOptions.path .. '", width: ' .. logoOptions.width .. altProp .. '))))')
255+
'#set page(background: align(' .. logoOptions.location .. ', box(inset: ' .. logoOptions.padding .. ', image("' .. dblbackslash .. '", width: ' .. logoOptions.width .. altProp .. '))))')
255256
end
256257
end
257258
end,

tests/docs/smoke-all/typst/brand-yaml/logo/relative-path/brand-logo.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _quarto:
1111
typst:
1212
ensureTypstFileRegexMatches:
1313
-
14-
- '#set page\(background: align\(center\+top, box\(inset: 2em, image\("brand_yaml/resources/quarto.png", width: 225pt\)\)\)\)'
14+
- '#set page\(background: align\(center\+top, box\(inset: 2em, image\("brand_yaml(/|\\\\)resources(/|\\\\)quarto.png", width: 225pt\)\)\)\)'
1515
- []
1616
---
1717

0 commit comments

Comments
 (0)