1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-02 16:38:37 +00:00

Add rewrite rule replace for custom search and replace

This commit is contained in:
Pacman99 2020-11-25 14:51:54 -08:00 committed by fguillot
parent de7a613098
commit b8b6c74d86
3 changed files with 34 additions and 1 deletions

View file

@ -221,3 +221,12 @@ func replaceTextLinks(input string) string {
func replaceLineFeeds(input string) string {
return strings.Replace(input, "\n", "<br>", -1)
}
func replaceCustom(entryContent string, searchTerm string, replaceTerm string) string {
re, err := regexp.Compile(searchTerm)
if err == nil {
return re.ReplaceAllString(entryContent, replaceTerm)
}
return entryContent
}