diff --git a/parser/parser_test.go b/parser/parser_test.go index f4747c38..e08e2083 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -497,6 +497,24 @@ a - b - c: value `, ` a - b - c: value +`, + }, + { + ` +a: +- + b: c + d: e +- + f: g + h: i +`, + ` +a: +- b: c + d: e +- f: g + h: i `, }, } diff --git a/scanner/scanner.go b/scanner/scanner.go index 0b287bbc..4bff2418 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -431,7 +431,7 @@ func (s *Scanner) scan(ctx *Context) (pos int) { continue } nc := ctx.nextChar() - if nc == ' ' { + if nc == ' ' || s.isNewLineChar(nc) { s.addBufferedTokenIfExists(ctx) ctx.addOriginBuf(c) tk := token.SequenceEntry(string(ctx.obuf), s.pos())