Skip to content

Commit

Permalink
fix: Add more robustness to master document parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Dec 8, 2023
1 parent bfcc8d8 commit bc3f04f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inputters/silm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ function inputter:parse (doc)
end

-- Document wrap-up
local options = master.sile.options or {}
local options = sile.options or {}
local classopts = isRoot and {
class = options.class or "resilient.book", -- Sane default. We Are Resilient.
papersize = options.papersize,
Expand Down
5 changes: 5 additions & 0 deletions lua-libraries/resilient-tinyyaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,11 @@ end
-- : (list<str>)->dict
function Parser:parsedocuments(lines)
lines = compactifyemptylines(lines)
-- BEGIN MODIFIED RESILIENT
if #lines == 0 then
return {}
end
-- END MODIFIED RESILIENT

if sfind(lines[1], '^%%YAML') then tremove(lines, 1) end

Expand Down

0 comments on commit bc3f04f

Please sign in to comment.