mirror of
https://git.sr.ht/~sircmpwn/aerc
synced 2024-11-26 05:38:27 +01:00
ea4fe71360
Presumably some email servers will transform newlines into carriage return new lines to better support windows users. I can't prove this but that's the best explanation I have for my hosted email provider (fastmail). Without this patch, I was seeing annoying `^M`s at the end of every filtered line. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
17 lines
243 B
Awk
Executable File
17 lines
243 B
Awk
Executable File
# 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
|
|
}
|
|
}
|