Skip to content

Commit

Permalink
fixed crash when dashed syllable contains space
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxfighter committed Jun 14, 2020
1 parent 493fb9b commit a887bb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion word.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ func (w *Word) doUnderline(markdown bool) (string, error) {
shUnderlineA := "\033[4m"
shUnderlineB := "\033[0m"
dashed := w.Syllables
dSlice := strings.Split(dashed, "-")
dSlice := strings.FieldsFunc(dashed, func(r rune) bool {
return r == '-' || r == ' '
})

stressedIndex, err := strconv.Atoi(w.Stressed)
if err != nil {
Expand Down

0 comments on commit a887bb6

Please sign in to comment.