isTopLevelKey checks if a line is a top-level YAML key (no indentation, contains colon, not a comment)
(line string)
| 51 | |
| 52 | // isTopLevelKey checks if a line is a top-level YAML key (no indentation, contains colon, not a comment) |
| 53 | func isTopLevelKey(line string) bool { |
| 54 | trimmed := strings.TrimSpace(line) |
| 55 | if trimmed == "" || strings.HasPrefix(trimmed, "#") { |
| 56 | return false |
| 57 | } |
| 58 | indent := getIndentation(line) |
| 59 | return indent == "" && strings.Contains(line, ":") |
| 60 | } |
| 61 | |
| 62 | // isNestedUnder checks if currentLine is nested under (has more indentation than) parentIndent |
| 63 | func isNestedUnder(currentLine, parentIndent string) bool { |