summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xfilters/plaintext16
2 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 58e51b2..58ffc16 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 0000000..cfaa170
--- /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
+ }
+}