Fixed new line parsing error

pull/2/head
Aaron Johnon 1 year ago
parent d5ddbf521c
commit 57cbc99379

@ -26,7 +26,7 @@ const (
func main() {
// Define and parse the -r flag
repeat := flag.Bool("r", false, "Repeat each section separated by space, '-', or '_'")
repeat := flag.Bool("r", false, "Repeat each section separated by space, '-', '_', or a new line")
flag.Parse()
// Create a map to store sound data for each character
@ -101,7 +101,7 @@ func main() {
// Process the input
input = strings.ToLower(strings.TrimSpace(input))
sections := strings.FieldsFunc(input, func(r rune) bool {
return r == ' ' || r == '-' || r == '_'
return r == ' ' || r == '-' || r == '_' || r == '\n' || r == '\r'
})
fmt.Println("Beginning playback...")

Loading…
Cancel
Save