Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandoc-ling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ function processDiv (div)

-- keep track of chapters (header == 1)
-- included in this loop by trick "addDivToHeader"
if div.content[1].tag == "Header" and div.content[1].classes[1] == "restart" then
if #div.content > 0 and div.content[1].tag == "Header" and
div.content[1].classes[1] == "restart" then
chapter = chapter + 1
counterInChapter = 0
div.content[1].attr = {id = div.content[1].identifier, class = ""}
Expand Down