go-nestedtext

NestedText in Go (alpha)
Log | Files | Refs | README | LICENSE

commit 54f33ea1445afcb1b0bc690c5a8cdb0a8cf3705f
parent 85782485938d668919a4d389ddd05ac73a83bff1
Author: Byron Torres <b@torresjrjr.com>
Date:   Fri, 30 Apr 2021 02:31:50 +0100

Fix key extraction on KeyEmpty lines

Diffstat:
M.gitignore | 1+
Mnestedtext.go | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore @@ -1,2 +1,3 @@ tmp/ go-nestedtext +nt diff --git a/nestedtext.go b/nestedtext.go @@ -130,7 +130,7 @@ func parseNestedText(scanner *bufio.Scanner, parentIndent string, root bool) int // fmt.Println("NESTING") // TODO: Check if correct. key := strings.TrimSuffix(line, ":") - key = strings.TrimSuffix(line, ": ") + key = strings.TrimSuffix(key, ": ") key = strings.TrimSpace(key) child := parseNestedText(scanner, localIndent, false)