filters: restore plaintext awk script
This script is referenced by some users configuration. Restore it to
avoid breaking existing setups.
Fixes: bca93cd915
("filters: add a more complete plaintext filter")
Signed-off-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
c63ca9bd9c
commit
9dc2803220
2 changed files with 17 additions and 0 deletions
1
Makefile
1
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
|
||||
|
|
16
filters/plaintext
Executable file
16
filters/plaintext
Executable file
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue