Skip to content

Commit

Permalink
Merge pull request #11010 from quarto-dev/bugfix/10438
Browse files Browse the repository at this point in the history
Bugfix/10438
  • Loading branch information
cscheid authored Oct 8, 2024
2 parents 2f664c4 + 3f1cb05 commit 39ac228
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
3 changes: 2 additions & 1 deletion news/changelog-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/resources/filters/quarto-post/typst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/docs/smoke-all/2024/04/26/9365.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ _quarto:
- []
typst:
ensureTypstFileRegexMatches:
- ['<test-table>[\s]*#figure\(']
- ['<test-table>[\s]*#block\[[\s]*#figure\(']
- ['<test-table>[\s]*#table\(']
- ['<test-table>[\s]*#block\[[\s]*#table\(']
---

# Test table {#test-table}
Expand Down
32 changes: 32 additions & 0 deletions tests/docs/smoke-all/2024/10/08/issue-10438.qmd
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion tests/docs/smoke-all/typst/tbl-align-issue10086.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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']
---
Expand Down

0 comments on commit 39ac228

Please sign in to comment.