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:
parent
de7a613098
commit
b8b6c74d86
3 changed files with 34 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue