aboutsummaryrefslogtreecommitdiffstats
path: root/lib/templates/functions.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-09-08 17:45:25 -0500
committerRobin Jarry <robin@jarry.cc>2024-09-20 09:28:50 +0200
commit49afb059bc98eea905b7e2f3c7e8eed89b90f2d4 (patch)
tree6d67c5206b59d5cf526c2b4490daa6da00a20b25 /lib/templates/functions.go
parent2d6b2c0e7bee7a029fe97617ef870208937a39d3 (diff)
downloadaerc-49afb059bc98eea905b7e2f3c7e8eed89b90f2d4.tar.gz
templates/quote: only prefix quoted lines with '>'
Prefix all quoted lines with depth > 1 with '>'. Quoted lines of depth 1 are quoted with "> ". This follows conventions of mailing lists which collapse quote depths without spaces. For example: >>> Quote depth 3 > Quote depth 1 >> Quote depth 2 Changelog-changed: Template function `quote` only prefixes with a space if at quote depth 1. Requested-by: Isaac Freund <mail@isaacfreund.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/templates/functions.go')
-rw-r--r--lib/templates/functions.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/templates/functions.go b/lib/templates/functions.go
index 0d204b8f..8a415b1f 100644
--- a/lib/templates/functions.go
+++ b/lib/templates/functions.go
@@ -84,7 +84,11 @@ func quote(text string) string {
quoted.WriteString(">\n")
continue
}
- quoted.WriteString("> ")
+ if strings.HasPrefix(line, ">") {
+ quoted.WriteString(">")
+ } else {
+ quoted.WriteString("> ")
+ }
quoted.WriteString(line)
quoted.WriteRune('\n')
}