Skip to content

Commit 0b46497

Browse files
committed
Loosen up textsafe impl, add another path to test
1 parent 9fff5b7 commit 0b46497

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/resources/filters/quarto-post/pdf-images.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local resolvedUrls = {}
2727
-- replace invalid tex characters with underscores
2828
local tex_safe_filename = function(filename)
2929
-- return filename
30-
return filename:gsub('[^%w%.%-]', '-')
30+
return filename:gsub("[ <>()|:&;#?*'\\/]", '-')
3131
end
3232

3333
function pdfImages()

tests/docs/smoke-all/2023/01/17/online-image-mediabag.qmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ _quarto:
1515
![](https://raw.githubusercontent.com/quarto-dev/quarto-web/main/docs/get-started/hello/rstudio/lter_penguins.png){style="float:right;" fig-alt="Illustration of three species of Palmer Archipelago penguins: Chinstrap, Gentoo, and Adelie. Artwork by @allison_horst." width="401"}
1616

1717

18+
## The below is a path with invalid characters
19+
20+
It is important that the path end with `.jpeg`, otherwise the default extension will be appended to the path _before_ it is downloaded and used post download. In the case of PDFs, the default extension is `pdf`.
21+
22+
![Great Pyramid](https://sat02pap004files.storage.live.com/y4m52ot143vPFNPo0C4wwvFwbWGJz9PYvIxAv3aPcZV9KHpimnZ2ErrEafT22gFuFM3lP-nJYiGpwzfq1wJ2X-kPIroYIPqhzYm01Hx6B4x40cPkesS9FVXJvFfkj9mtdBGFOhl1WVJd0xushOybTa9GTYsn-tKZCn7T0IAHSplCK-VBGhncjA-D09aJ-fJ8Ldq?width=256&height=192&cropmode=none&foobar=.jpeg)

0 commit comments

Comments
 (0)