~rjarry/aerc

49afb059bc98eea905b7e2f3c7e8eed89b90f2d4 — Tim Culverhouse a month ago 2d6b2c0
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>
1 files changed, 5 insertions(+), 1 deletions(-)

M lib/templates/functions.go
M lib/templates/functions.go => lib/templates/functions.go +5 -1
@@ 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')
	}