Fixing go 1.11 compatibility issue in strings lib w replaceAll vs replace

This commit is contained in:
sloumdrone 2020-01-04 12:48:15 -08:00
parent b4e077869f
commit 77fe67525e
1 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ func (p *Page) HighlightFoundText() {
if bombadillo.Options["theme"] == "inverse" {
format = "\033[27m%s\033[7m"
}
ln = strings.ReplaceAll(ln, p.SearchTerm, fmt.Sprintf(format, p.SearchTerm))
ln = strings.Replace(ln, p.SearchTerm, fmt.Sprintf(format, p.SearchTerm), -1)
p.WrappedContent[i] = ln
}
}
@ -153,7 +153,7 @@ func (p *Page) FindText() {
if found < 0 {
continue
}
ln = strings.ReplaceAll(ln, s, fmt.Sprintf(format, s))
ln = strings.Replace(ln, s, fmt.Sprintf(format, s), -1)
p.WrappedContent[i] = ln
p.FoundLinkLines = append(p.FoundLinkLines, i)
}