Skip to content

Commit

Permalink
fix: skip empty block style string (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander authored Dec 3, 2021
1 parent 153836c commit b029ced
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tinyyaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ local function parseblockstylestring(line, lines, indent)
else
error('invalid blockstyle string:'..line)
end

if #s == 0 then
return ""
end

local _, eonl = s[#s]:gsub('\n', '\n')
s[#s] = rtrim(s[#s])
if striptrailing then
Expand Down

0 comments on commit b029ced

Please sign in to comment.