Ver código fonte

Use strings.ReplaceAll instead of strings.Replace(…, -1)

jvoisin 2 anos atrás
pai
commit
fa12c23d79

+ 1 - 1
internal/reader/media/media.go

@@ -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>`)
 }
 

+ 1 - 1
internal/reader/rewrite/rewrite_functions.go

@@ -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 {