Commit graph

8 commits

Author SHA1 Message Date
Robin Jarry
3ef4a3ca05 filters: try and make awk scripts posix compliant
\x escape sequences are GNU specific. Use the octal escape code instead.

filters/calendar is beyond help. It would need a complete rewrite to
make it work with POSIX awk.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-07-18 13:58:21 +02:00
Tom Schwindl
fc4301113e filters: Add missing shebangs
The hldiff and plaintext filter scripts are missing their shebangs.
Add those to be correct and consistent.
Additionally, remove the vim comment, it's unnecessary.

Signed-off-by: Tom Schwindl <schwindl@posteo.de>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-07-11 15:53:23 +02:00
Robin Jarry
9dc2803220 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>
2022-02-20 23:46:29 +01:00
Robin Jarry
c63ca9bd9c filters: rename plaintext to colorize
This filter script is not compatible with the previous one. Rename it to
avoid issues with existing configs.

Fixes: bca93cd915 ("filters: add a more complete plaintext filter")
Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-20 23:46:29 +01:00
Robin Jarry
bca93cd915 filters: add a more complete plaintext filter
Colorize most plain text messages.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-19 22:14:27 +01:00
Robin Jarry
7c3ce816c8 config: set a default filter for text/plain
Avoid the following issue when running aerc with the default
configuration:

  No filter configured for this mimetype ('text/plain')

Use a very basic sed command to replace the default plaintext filter.

Fixes: bb0f180140 ("config: do not hardcode sharedir")
Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-19 22:12:16 +01:00
Daniel Xu
ea4fe71360 Strip carriage returns (^M) when filtering emails
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>
2019-08-20 16:05:20 +09:00
Drew DeVault
177651bdda Move contrib -> filters 2019-06-27 09:32:46 -04:00
Renamed from contrib/plaintext (Browse further)