bd sync: 2025-11-05 13:56:12

This commit is contained in:
Steve Yegge
2025-11-05 13:56:12 -08:00
parent 187c395e3e
commit 3973ccbfa3
5 changed files with 81 additions and 4 deletions

View File

@@ -40,8 +40,16 @@ type IssueTemplate struct {
}
// parsePriority extracts and validates a priority value from content.
// Supports both numeric (0-4) and P-prefix format (P0-P4).
// Returns the parsed priority (0-4) or -1 if invalid.
func parsePriority(content string) int {
content = strings.TrimSpace(content)
// Handle "P1", "P0", etc. format
if strings.HasPrefix(strings.ToUpper(content), "P") {
content = content[1:] // Strip the "P" prefix
}
var p int
if _, err := fmt.Sscanf(content, "%d", &p); err == nil && p >= 0 && p <= 4 {
return p