diff options
author | Robin Jarry <robin@jarry.cc> | 2022-02-20 23:37:34 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-02-20 23:46:29 +0100 |
commit | 9dc28032201f5dd8bd3e446d9c4230ae5149ab47 (patch) | |
tree | 93b118d6aff7e641e91fb87ee919dcd750025135 | |
parent | c63ca9bd9c064781f7aa8b2b96d1d9854e757db2 (diff) | |
download | aerc-9dc28032201f5dd8bd3e446d9c4230ae5149ab47.tar.gz |
filters: restore plaintext awk script
This script is referenced by some users configuration. Restore it to
avoid breaking existing setups.
Fixes: bca93cd91536 ("filters: add a more complete plaintext filter")
Signed-off-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | filters/plaintext | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -92,6 +92,7 @@ install: $(DOCS) aerc install -m755 filters/colorize $(DESTDIR)$(SHAREDIR)/filters/colorize install -m755 filters/hldiff $(DESTDIR)$(SHAREDIR)/filters/hldiff install -m755 filters/html $(DESTDIR)$(SHAREDIR)/filters/html + install -m755 filters/plaintext $(DESTDIR)$(SHAREDIR)/filters/plaintext install -m644 templates/new_message $(DESTDIR)$(SHAREDIR)/templates/new_message install -m644 templates/quoted_reply $(DESTDIR)$(SHAREDIR)/templates/quoted_reply install -m644 templates/forward_as_body $(DESTDIR)$(SHAREDIR)/templates/forward_as_body diff --git a/filters/plaintext b/filters/plaintext new file mode 100755 index 00000000..cfaa170e --- /dev/null +++ b/filters/plaintext @@ -0,0 +1,16 @@ +# vim: set ft=awk : +BEGIN { + dim = "\x1B[2m" + cyan = "\x1B[36m" + reset = "\x1B[0m" +} +{ + # Strip carriage returns from line + gsub(/\r/, "", $0) + + if ($0 ~ /^On .*, .* wrote:/ || $0 ~ /^>+/) { + print dim cyan $0 reset + } else { + print $0 + } +} |