feat(typst.hs): Add alt text support for images in Typst writer (accessibility)#11394
Closed
feat(typst.hs): Add alt text support for images in Typst writer (accessibility)#11394
Conversation
7df57ac to
cf221db
Compare
for consistency with HTML/LaTeX
cf221db to
9b0df51
Compare
Contributor
Author
|
As expected, the old test now breaks because it is missing the alt-text generated similarly to LateX and HTML 2026-01-10T22:52:08.1982438Z 9236.md
2026-01-10T22:52:08.2923875Z #1: FAIL (0.01s)
2026-01-10T22:52:08.2924508Z --- test/command/9236.md
2026-01-10T22:52:08.2924933Z +++ pandoc -t typst
2026-01-10T22:52:08.2925448Z + 1 #figure(image("command/minimal.svg", alt: "minimal", width: 3in),
2026-01-10T22:52:08.2926050Z - 1 #figure(image("command/minimal.svg", width: 3in),
2026-01-10T22:52:08.2926503Z + 7 #figure(image("command/minimal.svg", alt: "minimal", height: 2in, width: 3in),
2026-01-10T22:52:08.2926997Z - 7 #figure(image("command/minimal.svg", height: 2in, width: 3in),
2026-01-10T22:52:08.2927403Z + 13 #figure(image("command/minimal.svg", alt: "minimal"),
2026-01-10T22:52:08.2927754Z - 13 #figure(image("command/minimal.svg"),
2026-01-10T22:52:08.2928036Z + 19 And inline:
2026-01-10T22:52:08.2928450Z + 20 #box(image("command/minimal.svg", alt: "minimal", height: 2in)) and
2026-01-10T22:52:08.2929232Z + 21 #box(image("command/minimal.svg", alt: "minimal")).
2026-01-10T22:52:08.2929625Z - 19 And inline: #box(image("command/minimal.svg", height: 2in)) and
2026-01-10T22:52:08.2929994Z - 20 #box(image("command/minimal.svg")).
2026-01-10T22:52:08.2930261Z
2026-01-10T22:52:08.2930499Z Use -p '/9236.md.#1/' to rerun this test only. |
Contributor
|
I can't seem to make a suggested edit due to the content being markdown. We discovered a couple other test cases in my version of this. |
gordonwoodhull
added a commit
to quarto-dev/quarto-cli
that referenced
this pull request
Jan 11, 2026
Closes #13868 Workaround for Pandoc not passing alt text to Typst image() calls. When an image has alt text (from caption or explicit alt attribute), emit raw Typst with image(..., alt: "...") for accessibility. This is a temporary fix until jgm/pandoc#11394 is merged upstream. - Add alt text handling in render_typst_fixups() Image filter - Alt parameter placed second after filename (matches Pandoc PR) - Escape backslashes and quotes in alt text - Add comprehensive test coverage with unique test images - Replace test-image.png with smaller penrose.svg Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
Author
|
@gordonwoodhull Do you see something else regarding Quarto use? |
Contributor
|
I’ve implemented a character-for-character equivalent workaround in Quarto as part of quarto-dev/quarto-cli#13857, since we probably won’t update our Pandoc again until 1.10. |
gordonwoodhull
added a commit
to quarto-dev/quarto-cli
that referenced
this pull request
Jan 13, 2026
Closes #13868 Workaround for Pandoc not passing alt text to Typst image() calls. When an image has alt text (from caption or explicit alt attribute), emit raw Typst with image(..., alt: "...") for accessibility. This is a temporary fix until jgm/pandoc#11394 is merged upstream. - Add alt text handling in render_typst_fixups() Image filter - Alt parameter placed second after filename (matches Pandoc PR) - Escape backslashes and quotes in alt text - Add comprehensive test coverage with unique test images - Replace test-image.png with smaller penrose.svg Co-Authored-By: Claude Opus 4.5 <[email protected]>
gordonwoodhull
added a commit
to quarto-dev/quarto-cli
that referenced
this pull request
Jan 14, 2026
Closes #13868 Workaround for Pandoc not passing alt text to Typst image() calls. When an image has alt text (from caption or explicit alt attribute), emit raw Typst with image(..., alt: "...") for accessibility. This is a temporary fix until jgm/pandoc#11394 is merged upstream. - Add alt text handling in render_typst_fixups() Image filter - Alt parameter placed second after filename (matches Pandoc PR) - Escape backslashes and quotes in alt text - Add comprehensive test coverage with unique test images - Replace test-image.png with smaller penrose.svg Co-Authored-By: Claude Opus 4.5 <[email protected]>
gordonwoodhull
added a commit
to quarto-dev/quarto-cli
that referenced
this pull request
Jan 21, 2026
Closes #13868 Workaround for Pandoc not passing alt text to Typst image() calls. When an image has alt text (from caption or explicit alt attribute), emit raw Typst with image(..., alt: "...") for accessibility. This is a temporary fix until jgm/pandoc#11394 is merged upstream. - Add alt text handling in render_typst_fixups() Image filter - Alt parameter placed second after filename (matches Pandoc PR) - Escape backslashes and quotes in alt text - Add comprehensive test coverage with unique test images - Replace test-image.png with smaller penrose.svg Co-Authored-By: Claude Opus 4.5 <[email protected]>
Owner
|
Closing this in favor of a fresh change. I borrowed your test file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce support for alt text in images within the Typst writer, enhancing accessibility.
Behaviour is by design consistent with LaTeX and HTML writers.
TO-DO: Check if the following files need to account for alt as welltest/command/9945.mdthis might now get an alternative-text not expected at the time.This was identified in Quarto CLI that the alt-text was not forwarded.
Resolves quarto-dev/quarto-cli#13868