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>
16 lines
243 B
Awk
Executable file
16 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
|
|
}
|
|
}
|