Skip to content

Commit e7ce5af

Browse files
authored
Bugfix/issue 3772 (#3905)
* only append to content if it's paragraph. Closes #3772
1 parent 3f97864 commit e7ce5af

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

news/changelog-1.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
- `quarto check` now supports `quarto check versions` for checking binary dependency versions in the case of custom binaries ([#3602](https://github.com/quarto-dev/quarto-cli/issues/3602)).
107107
- the API for shortcode handlers in lua now accepts a fourth parameter `raw_args` which hold the unparsed arguments in a table ([#3833](https://github.com/quarto-dev/quarto-cli/issues/3833)).
108108
- remove scaffolding div from conditional content in final output ([#3847](https://github.com/quarto-dev/quarto-cli/issues/3847)).
109+
- ensure proof titles are appended to paragraph nodes ([#3772](https://github.com/quarto-dev/quarto-cli/issues/3772)).
109110

110111
## Pandoc filter changes
111112

src/resources/filters/crossref/theorems.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,15 @@ function crossrefTheorems()
143143
span.content:insert(pandoc.Str(")"))
144144
end
145145
tappend(span.content, { pandoc.Str(". ")})
146+
147+
-- if the first block is a paragraph, then prepend the title span
146148
if #el.content > 0 and
147-
el.content[1].content ~= nil and #el.content[1].content > 0 then
149+
el.content[1].t == "Para" and
150+
el.content[1].content ~= nil and
151+
#el.content[1].content > 0 then
148152
el.content[1].content:insert(1, span)
149153
else
150-
-- if the first block can't handle content insertion
151-
-- then insert a new paragraph
154+
-- else insert a new paragraph
152155
el.content:insert(1, pandoc.Para{span})
153156
end
154157
end

0 commit comments

Comments
 (0)