mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Add replace_title
write rule to adjust entry titles
This commit is contained in:
parent
a0ae5a6868
commit
69738bce84
2 changed files with 23 additions and 0 deletions
|
@ -91,6 +91,13 @@ func applyRule(entryURL string, entry *model.Entry, rule rule) {
|
|||
} else {
|
||||
logger.Debug("[Rewrite] Cannot find search and replace terms for replace rule %s", rule)
|
||||
}
|
||||
case "replace_title":
|
||||
// Format: replace_title("search-term"|"replace-term")
|
||||
if len(rule.args) >= 2 {
|
||||
entry.Title = replaceCustom(entry.Title, rule.args[0], rule.args[1])
|
||||
} else {
|
||||
logger.Debug("[Rewrite] Cannot find search and replace terms for replace rule %s", rule)
|
||||
}
|
||||
case "remove":
|
||||
// Format: remove("#selector > .element, .another")
|
||||
if len(rule.args) >= 1 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue