In the following file, the second item (bar) does not appear in the parsed data. Changing the value of foo for an inline value solves the problem.
This is because the first token after the | is an indent, and it is not counted towards the number of indents to undo to finish a textblock. Here's a fix:
diff --git a/yaml.lua b/yaml.lua
index 55211dc..6432b4a 100644
--- a/yaml.lua
+++ b/yaml.lua
@@ -448,6 +448,9 @@ Parser.parseTextBlock = function (self, sep)
local token = self:advance()
local result = string_trim(token.raw, "\n")
local indents = 0
+ if token[1] == "indent" then
+ indents = 1
+ end
while self:peek() ~= nil and ( indents > 0 or not self:peekType("dedent") ) do
local newtoken = self:advance()
while token.row < newtoken.row do
In the following file, the second item (
bar) does not appear in the parsed data. Changing the value offoofor an inline value solves the problem.This is because the first token after the | is an indent, and it is not counted towards the number of indents to undo to finish a textblock. Here's a fix: