File tree Expand file tree Collapse file tree 6 files changed +65
-2
lines changed
tests/docs/smoke-all/2024/05/21 Expand file tree Collapse file tree 6 files changed +65
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ All changes included in 1.5:
1212- ([ #9539 ] ( https://github.com/quarto-dev/quarto-cli/issues/9539 ) ): Improve SCSS of title blocks to avoid overwide columns in grid layout.
1313- Improve accessibility ` role ` for ` aria-expandable ` elements by ensuring their role supports the ` aria-expanded ` attribute.
1414- ([ #3178 ] ( https://github.com/quarto-dev/quarto-cli/issues/3178 ) ): TOC now correctly expands when web page has no content to scroll to.
15+ - ([ #9734 ] ( https://github.com/quarto-dev/quarto-cli/issues/9734 ) ): Fix issue with unlabeled tables and ` tbl-cap-location ` information.
1516
1617## PDF Format
1718
Original file line number Diff line number Diff line change @@ -118,9 +118,13 @@ function cap_location(obj)
118118 -- ref-parents
119119 ref = refType (obj .identifier ) or refType (obj .attributes [" ref-parent" ] or " " )
120120 end
121- -- last resort, pretend we're a figure
122121 if ref == nil or crossref .categories .by_ref_type [ref ] == nil then
123- ref = " fig"
122+ if obj .t == " Table" then
123+ ref = " tbl"
124+ else
125+ -- last resort, pretend we're a figure
126+ ref = " fig"
127+ end
124128 end
125129 local qualified_key = ref .. ' -cap-location'
126130 local result = (
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ function render_html_fixups()
2222 end
2323
2424 return {
25+ Table = function (tbl )
26+ -- this requires bootstrap CSS
27+ if quarto .doc .crossref .cap_location (tbl ) == " top" then
28+ tbl .classes :insert (" caption-top" )
29+ return tbl
30+ end
31+ end ,
2532 Figure = function (fig )
2633 if # fig .content ~= 1 then
2734 return nil
Original file line number Diff line number Diff line change 1+ ---
2+ title : Table caption location
3+ tbl-cap-location : top
4+ format : html
5+ _quarto :
6+ tests :
7+ html :
8+ ensureHtmlElements :
9+ - ["table.caption-top"]
10+ ---
11+
12+ | Col1 | Col2 | Col3 |
13+ | ------| ------| ------|
14+ | A | B | C |
15+ | E | F | G |
16+
17+ : A non-labelled table with a caption
Original file line number Diff line number Diff line change 1+ ---
2+ title : Table caption location
3+ tbl-cap-location : bottom
4+ format : html
5+ _quarto :
6+ tests :
7+ html :
8+ ensureHtmlElements :
9+ - []
10+ - ["table.caption-top"]
11+ ---
12+
13+ | Col1 | Col2 | Col3 |
14+ | ------| ------| ------|
15+ | A | B | C |
16+ | E | F | G |
17+
18+ : A non-labelled table with a caption
Original file line number Diff line number Diff line change 1+ ---
2+ title : Table caption location
3+ format : html
4+ _quarto :
5+ tests :
6+ html :
7+ ensureHtmlElements :
8+ - ["table.caption-top"]
9+ ---
10+
11+ | Col1 | Col2 | Col3 |
12+ | ------| ------| ------|
13+ | A | B | C |
14+ | E | F | G |
15+
16+ : A non-labelled table with a caption
You can’t perform that action at this time.
0 commit comments