Skip to content

Commit

Permalink
Merge pull request #9220 from quarto-dev/bugfix/9219
Browse files Browse the repository at this point in the history
typst, theorems: use as_blocks instead of as_inlines
  • Loading branch information
cscheid authored Mar 29, 2024
2 parents 4ece652 + 8a58678 commit bc3fc8a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/resources/filters/customnodes/theorem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ end, function(thm)

elseif _quarto.format.isTypstOutput() then
ensure_typst_theorems(type)
-- el.content:insert(1, pandoc.RawInline("typst", "#" .. theorem_type.env .. "(\"" .. thm.name .. "\")["))
local callthm = pandoc.Para(pandoc.RawInline("typst", "#" .. theorem_type.env .. "("))
local preamble = pandoc.Plain({pandoc.RawInline("typst", "#" .. theorem_type.env .. "(")})
if name and #name > 0 then
callthm.content:insert(pandoc.RawInline("typst", '"'))
tappend(callthm.content, name)
callthm.content:insert(pandoc.RawInline("typst", '"'))
preamble.content:insert(pandoc.RawInline("typst", '"'))
tappend(preamble.content, name)
preamble.content:insert(pandoc.RawInline("typst", '"'))
end
callthm.content:insert(pandoc.RawInline("typst", ")["))
tappend(callthm.content, quarto.utils.as_inlines(el.content))
preamble.content:insert(pandoc.RawInline("typst", ")["))
local callthm = make_scaffold(pandoc.Div, preamble)
tappend(callthm.content, quarto.utils.as_blocks(el.content))
callthm.content:insert(pandoc.RawInline("typst", "] <" .. el.attr.identifier .. ">"))
return callthm

Expand Down
20 changes: 20 additions & 0 deletions tests/docs/smoke-all/2024/03/28/9219.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
format:
typst:
output-ext: typ
_quarto:
tests:
typst:
ensureFileRegexMatches:
- ["- item 1"]
- []
---

::: {#thm-some}

Some text:

- item 1
- item 2

:::

0 comments on commit bc3fc8a

Please sign in to comment.