diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index ec24f5d11f..b4c24baa57 100644 --- a/news/changelog-1.6.md +++ b/news/changelog-1.6.md @@ -46,7 +46,8 @@ All changes included in 1.6: - ([#10168](https://github.com/quarto-dev/quarto-cli/issues/10168)): Support `csl` bibliography style. - ([#10181](https://github.com/quarto-dev/quarto-cli/issues/10181)): Remove workaround for image dimensions which is no longer necessary and mishandled image paths with spaces. - ([#10217](https://github.com/quarto-dev/quarto-cli/issues/10217)): Explicitly compute units for image dimensions in `typst` format when they're not given. -- ([#10212](https://github.com/quarto-dev/quarto-cli/issues/10212)): Moves Pandoc variables to the function declaration for the default template. +- ([#10212](https://github.com/quarto-dev/quarto-cli/issues/10212)): Move Pandoc variables to the function declaration for the default template. +- ([#10438](https://github.com/quarto-dev/quarto-cli/issues/10438)): Ensure Pandoc doesn't emit its own crossref environments for table elements. ## `latex` and `pdf` Format diff --git a/src/resources/filters/quarto-post/typst.lua b/src/resources/filters/quarto-post/typst.lua index 57c7927365..347fbf8547 100644 --- a/src/resources/filters/quarto-post/typst.lua +++ b/src/resources/filters/quarto-post/typst.lua @@ -119,6 +119,11 @@ function render_typst_fixups() end return div end, + Table = function(tbl) + -- https://github.com/quarto-dev/quarto-cli/issues/10438 + tbl.classes:insert("typst:no-figure") + return tbl + end, Para = function(para) if #para.content ~= 1 then return nil diff --git a/tests/docs/smoke-all/2024/04/26/9365.qmd b/tests/docs/smoke-all/2024/04/26/9365.qmd index d5b36bef45..6e4416e497 100644 --- a/tests/docs/smoke-all/2024/04/26/9365.qmd +++ b/tests/docs/smoke-all/2024/04/26/9365.qmd @@ -10,8 +10,8 @@ _quarto: - [] typst: ensureTypstFileRegexMatches: - - ['[\s]*#figure\('] - - ['[\s]*#block\[[\s]*#figure\('] + - ['[\s]*#table\('] + - ['[\s]*#block\[[\s]*#table\('] --- # Test table {#test-table} diff --git a/tests/docs/smoke-all/2024/10/08/issue-10438.qmd b/tests/docs/smoke-all/2024/10/08/issue-10438.qmd new file mode 100644 index 0000000000..4524b77da2 --- /dev/null +++ b/tests/docs/smoke-all/2024/10/08/issue-10438.qmd @@ -0,0 +1,32 @@ +--- +format: + typst: + output-ext: typ +_quarto: + tests: + typst: + ensureFileRegexMatches: + - [] + - ['#figure\(\[\n#figure\('] +--- + +::: {#tbl-main layout-ncol=1} + +| A | B | +|---|---| +| 1 | 2 | +| 3 | 4 | + +: Caption 1 {#tbl-one} + +| 1 | 2 | +|---|---| +| A | B | +| C | D | + +: Caption 2 {#tbl-two} + +Main caption +::: + +See @tbl-main, @tbl-one, @tbl-two. \ No newline at end of file diff --git a/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd b/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd index bbfc420a32..79f42e70a0 100644 --- a/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd +++ b/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd @@ -8,7 +8,7 @@ _quarto: typst: ensureTypstFileRegexMatches: - - ['#figure\(\[(\r\n?|\n)#figure'] + ['#figure\(\[(\r\n?|\n)#table'] - ['#block\[(\r\n?|\n)#figure\(\[(\r\n?|\n)#block\[(\r\n?|\n)#figure'] ---