|
| 1 | +--- |
| 2 | +title: Crossref Div with Markdown captioned table do not duplicate caption |
| 3 | +format: html |
| 4 | +keep-tex: true |
| 5 | +keep-typ: true |
| 6 | +_quarto: |
| 7 | + tests: |
| 8 | + html: |
| 9 | + ensureHtmlElements: |
| 10 | + - |
| 11 | + - 'div#tbl-1.quarto-float figure.quarto-float.quarto-float-tbl table' |
| 12 | + - 'div#tbl-2.quarto-float figure.quarto-float.quarto-float-tbl table' |
| 13 | + - 'a[href="#tbl-1"].quarto-xref' |
| 14 | + - 'a[href="#tbl-2"].quarto-xref' |
| 15 | + - |
| 16 | + - 'div#tbl-1.quarto-float table caption' |
| 17 | + - 'div#tbl-2.quarto-float table caption' |
| 18 | + revealjs: |
| 19 | + ensureHtmlElements: |
| 20 | + - |
| 21 | + - 'div#tbl-1.quarto-float figure.quarto-float.quarto-float-tbl table' |
| 22 | + - 'div#tbl-2.quarto-float figure.quarto-float.quarto-float-tbl table' |
| 23 | + - 'a[href="#/tbl-1"].quarto-xref' |
| 24 | + - 'a[href="#/tbl-2"].quarto-xref' |
| 25 | + - |
| 26 | + - 'div#tbl-1.quarto-float table caption' |
| 27 | + - 'div#tbl-2.quarto-float table caption' |
| 28 | + docx: |
| 29 | + ensureDocxXpath: |
| 30 | + - |
| 31 | + - "//w:tbl//w:p//w:r//w:t[contains(text(), \"Table\u00a01\")]" |
| 32 | + - "//w:tbl//w:p//w:r//w:t[contains(text(), \"Table\u00a02\")]" |
| 33 | + - "//w:hyperlink[@w:anchor='tbl-1']" |
| 34 | + - "//w:hyperlink[@w:anchor='tbl-2']" |
| 35 | + - |
| 36 | + - "//w:tbl//w:tbl//w:tblCaption[contains(@w:val, 'caption for the table 1')]" |
| 37 | + - "//w:tbl//w:tbl//w:tblCaption[contains(@w:val, 'caption for the table 2')]" |
| 38 | +--- |
| 39 | + |
| 40 | +Pandoc's support Caption on Markdown table through a specific syntax: https://pandoc.org/MANUAL.html#extension-table_captions |
| 41 | + |
| 42 | +This test ensure we do catch the caption and do not duplicate |
| 43 | + |
| 44 | +## Using `:` syntax |
| 45 | + |
| 46 | +::: {#tbl-1} |
| 47 | + |
| 48 | +| Default | Left | Right | Center | |
| 49 | +|---------|:-----|------:|:------:| |
| 50 | +| 12 | 12 | 12 | 12 | |
| 51 | +| 123 | 123 | 123 | 123 | |
| 52 | +| 1 | 1 | 1 | 1 | |
| 53 | + |
| 54 | +: This is the caption for the table 1 |
| 55 | + |
| 56 | +::: |
| 57 | + |
| 58 | +See @tbl-1 |
| 59 | + |
| 60 | +## Using `Table:` syntax |
| 61 | + |
| 62 | +::: {#tbl-2} |
| 63 | + |
| 64 | +| Default | Left | Right | Center | |
| 65 | +|---------|:-----|------:|:------:| |
| 66 | +| 12 | 12 | 12 | 12 | |
| 67 | +| 123 | 123 | 123 | 123 | |
| 68 | +| 1 | 1 | 1 | 1 | |
| 69 | + |
| 70 | +Table: This is the caption for the table 2 |
| 71 | + |
| 72 | +::: |
| 73 | + |
| 74 | +See @tbl-2 |
0 commit comments