(content string)
| 695 | } |
| 696 | |
| 697 | func parseKeyValues(content string) map[string]string { |
| 698 | result := make(map[string]string) |
| 699 | lines := strings.Split(content, "\n") |
| 700 | for _, line := range lines { |
| 701 | line = strings.TrimSpace(line) |
| 702 | line = strings.TrimPrefix(line, "- ") |
| 703 | line = strings.TrimPrefix(line, "* ") |
| 704 | |
| 705 | // Support KEY=VALUE and KEY: VALUE formats |
| 706 | var key, value string |
| 707 | if idx := strings.Index(line, "="); idx > 0 { |
| 708 | key = strings.TrimSpace(line[:idx]) |
| 709 | value = strings.TrimSpace(line[idx+1:]) |
| 710 | } else if idx := strings.Index(line, ":"); idx > 0 { |
| 711 | key = strings.TrimSpace(line[:idx]) |
| 712 | value = strings.TrimSpace(line[idx+1:]) |
| 713 | } |
| 714 | |
| 715 | if key != "" && value != "" { |
| 716 | result[key] = value |
| 717 | } |
| 718 | } |
| 719 | return result |
| 720 | } |
| 721 | |
| 722 | // parseTopics parses the TOPICS section into a name→summary map. It accepts the |
| 723 | // new "name: summary" line format and the legacy bare/comma-separated names |
no outgoing calls
no test coverage detected