mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
cc72b8054c
This borrows a test case taken mostly from #11394 by @mcanouil but the code is fresh. The behavior is similar to what we have with the HTML and LaTeX writers. Obsoletes #11394. Co-authored by @mcanouil and Claude Opus 4.6.
1.4 KiB
1.4 KiB
% pandoc -f markdown-implicit_figures -t typst

^D
#box(image("image.png", alt: "Alt text from inlines"))
% pandoc -f markdown-implicit_figures -t typst
{alt="Explicit alt attribute"}
^D
#box(image("image.png", alt: "Explicit alt attribute"))
% pandoc -f markdown-implicit_figures -t typst
{alt="Explicit wins"}
^D
#box(image("image.png", alt: "Explicit wins"))
% pandoc -f markdown-implicit_figures -t typst

^D
#box(image("image.png"))
% pandoc -f markdown-implicit_figures -t typst
{alt=""}
^D
#box(image("image.png"))
% pandoc -t typst
{alt="Alt text describing the image"}
^D
#figure(image("image.png", alt: "Alt text describing the image"),
caption: [
Caption text
]
)
% pandoc -t typst

^D
#figure(image("image.png", alt: "Caption only"),
caption: [
Caption only
]
)
% pandoc -f markdown -t typst
{alt="A \"quoted\" phrase and C:\\path\\file"}
^D
#figure(image("test.png", alt: "A \"quoted\" phrase and C:\\path\\file"),
caption: [
Caption
]
)
% pandoc -f html -t typst
<img src="data:image/png;base64,iVBORw0KGgo=" alt="A small red dot">
^D
#box(image(bytes((137,80,78,71,13,10,26,10)), alt: "A small red dot"))