Skip to content

Commit

Permalink
Fix empty div headers error in lua filter
Browse files Browse the repository at this point in the history
  • Loading branch information
froggleston committed Apr 19, 2024
1 parent 415d3b9 commit b8c9a94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# sandpaper 0.16.5.9000 (2024-04-19)

## BUG FIXES

* Fix for empty divs when checking for headers
(reported: @dmgatti, #581; fixed @froggleston)


# sandpaper 0.16.4 (2024-04-10)

## NEW FEATURES
Expand Down
5 changes: 5 additions & 0 deletions inst/rmarkdown/lua/lesson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ function level_head(el, level)
local id = 1
local header = el.content[id]

-- fix for https://github.com/carpentries/sandpaper/issues/581
if header == nil then
return el
end

if level ~= 0 and header.level == nil then
-- capitalize the first letter and insert it at the top of the block
local C = text.upper(text.sub(class, 1, 1))
Expand Down

0 comments on commit b8c9a94

Please sign in to comment.