slurp
slurp copied to clipboard
Add the ability to apply regex in property templates
Continuing indirectly from #18:
How about something like cleanup tasks for specific properties? Right now, we have s|...{s}
to simple replacements, but for instance, I'd like to add a rule that replaces every instance of post
with article
in a given property.
Another case I sometimes stumbled upon is how certain websites add the website name to the title, for instance, with this article, | Techcrunch
gets added to the title property, even though I already have that information in the site
key.
https://techcrunch.com/2024/05/06/boeing-starliners-first-crewed-mission-scrubbed/
Being able to define a regex that cleans up the value of a property might solve those issues
seems like that shouldn't be too hard to add to the existing template feature. i'm not crazy about the current template formatter functions anyway, so this would be a good excuse to refactor them.