email+cal fixes

This commit is contained in:
Henrik Bakken
2025-06-03 00:40:33 +02:00
parent c81a9f52b7
commit c518d33d64
7 changed files with 65 additions and 25 deletions
+8
View File
@@ -0,0 +1,8 @@
X-Mailer: aerc {{version}}
Forwarded message from {{.OriginalFrom | names | join ", "}} on {{dateFormat .OriginalDate "Mon Jan 2, 2006 at 3:04 PM"}}:
{{.OriginalText}}
{{- with .Signature }}
{{.}}
{{- end }}
+5
View File
@@ -0,0 +1,5 @@
X-Mailer: aerc {{version}}
{{- with .Signature }}
{{.}}
{{- end -}}
+23
View File
@@ -0,0 +1,23 @@
X-Mailer: aerc {{version}}
On {{dateFormat (.OriginalDate | toLocal) "Mon Jan 2, 2006 at 3:04 PM MST"}}, {{.OriginalFrom | names | join ", "}} wrote:
{{ if or
(eq .OriginalMIMEType "text/html")
(contains (toLower .OriginalText) "<html")
}}
{{- $text := exec `/usr/lib/aerc/filters/html` .OriginalText | replace `\r` `` -}}
{{- range split "\n" $text -}}
{{- if or
(eq (len .) 0)
(match `^\[.+\]\s*$` .)
}}{{continue}}{{end}}
{{- printf "%s\n" . | replace `^[\s]+` "" | quote}}
{{- end -}}
{{- else }}
{{- trimSignature .OriginalText | quote -}}
{{- end -}}
{{- with .Signature }}
{{.}}
{{- end }}