-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9191 from quarto-dev/bugfix/9190
lua - don't strip fig-alt from image when rendering html figure
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
dev-docs/feature-format-matrix/qmd-files/image/alt-text/document.qmd
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: "Alt text" | ||
format: | ||
html: | ||
quality: 2 | ||
revealjs: | ||
quality: 2 | ||
_quarto: | ||
tests: | ||
html: &html_like_tests | ||
ensureHtmlElements: | ||
- ['img#case1[alt="Alt"]', | ||
'img#case2[alt="Alt"]', | ||
'div#fig-case3 img[alt="Alt"]', | ||
'div#fig-case4 img[alt="Alt"]', | ||
'div#tbl-case5 img[alt="Alt"]', | ||
'div#tbl-case6 img[alt="Alt"]'] | ||
- [] | ||
revealjs: *html_like_tests | ||
--- | ||
|
||
## In HTML | ||
|
||
With caption, becomes a pandoc.Figure, but not a float: | ||
|
||
![Caption](https://placeholder.co/400/400){#case1 fig-alt="Alt"} | ||
|
||
Without caption, it's simply an image: | ||
|
||
![](https://placeholder.co/400/400){#case2 fig-alt="Alt"} | ||
|
||
In crossreferenceable figures, with and without captions: | ||
|
||
![Caption](https://placeholder.co/400/400){#fig-case3 fig-alt="Alt"} | ||
|
||
![](https://placeholder.co/400/400){#fig-case4 fig-alt="Alt"} | ||
|
||
In crossreferenceable non-figure floats, with and without captions: | ||
|
||
![Caption](https://placeholder.co/400/400){#tbl-case5 fig-alt="Alt"} | ||
|
||
![](https://placeholder.co/400/400){#tbl-case6 fig-alt="Alt"} | ||
|
||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: "Alt text" | ||
_quarto: | ||
tests: | ||
html: | ||
ensureHtmlElements: | ||
- ['img[alt="Alt"]'] | ||
- [] | ||
--- | ||
|
||
![Caption](https://placeholder.co/400/400){fig-alt="Alt"} |