Use strings.ReplaceAll instead of strings.Replace(…, -1)
This commit is contained in:
parent
4fe902a5d2
commit
fa12c23d79
2 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ func (d *Description) HTML() string {
|
|||
return d.Description
|
||||
}
|
||||
|
||||
content := strings.Replace(d.Description, "\n", "<br>", -1)
|
||||
content := strings.ReplaceAll(d.Description, "\n", "<br>")
|
||||
return textLinkRegex.ReplaceAllString(content, `<a href="${1}">${1}</a>`)
|
||||
}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ func replaceTextLinks(input string) string {
|
|||
}
|
||||
|
||||
func replaceLineFeeds(input string) string {
|
||||
return strings.Replace(input, "\n", "<br>", -1)
|
||||
return strings.ReplaceAll(input, "\n", "<br>")
|
||||
}
|
||||
|
||||
func replaceCustom(entryContent string, searchTerm string, replaceTerm string) string {
|
||||
|
|
Loading…
Reference in a new issue