aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-02-20 23:37:34 +0100
committerRobin Jarry <robin@jarry.cc>2022-02-20 23:48:44 +0100
commitc761ccc869ce03472c0c1eff37f78bb332af7437 (patch)
tree2f47315414a28391aedff57f8eb699d0d52500bd
parent04b3d172e0f76265a5239c3cceeebdc3be5e73f7 (diff)
downloadaerc-c761ccc869ce03472c0c1eff37f78bb332af7437.tar.gz
aerc-c761ccc869ce03472c0c1eff37f78bb332af7437.zip
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--Makefile1
-rwxr-xr-xfilters/plaintext16
2 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4481a8b2..2034c7e7 100644
--- a/Makefile
+++ b/Makefile
@@ -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
+ }
+}