Skip to content

Commit

Permalink
Improve handling of empty theorems
Browse files Browse the repository at this point in the history
Ensure this document will properly render (not empty theorem)

```
You can use @exm-boids to explore how these three rules influence the simulated
flocking behaviour in birds.

:::{#exm-boids}

#### Explore flocking behaviour

:::
````

Fixes #2354
  • Loading branch information
dragonstyle committed Sep 14, 2022
1 parent 537c06a commit c16212c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/resources/filters/crossref/theorems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ function theorems()
table.insert(prefix, pandoc.Str(")"))
table.insert(prefix, pandoc.Space())
end


-- If this theorem has no content, then create a placeholder
if #el.content == 0 then
el.content[1] = pandoc.Para({})
end

-- prepend the prefix
local caption = el.content[1]
tprepend(caption.content, {
Expand Down

0 comments on commit c16212c

Please sign in to comment.