about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/templates/template.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go
index 6eae5a2..5402472 100644
--- a/lib/templates/template.go
+++ b/lib/templates/template.go
@@ -97,6 +97,7 @@ func wrapLine(text string, lineWidth int) string {
 
 func wrapText(text string, lineWidth int) string {
 	text = strings.ReplaceAll(text, "\r\n", "\n")
+	text = strings.TrimRight(text, "\n")
 	lines := strings.Split(text, "\n")
 	var wrapped strings.Builder
 
@@ -118,6 +119,7 @@ func wrapText(text string, lineWidth int) string {
 // quote prepends "> " in front of every line in text
 func quote(text string) string {
 	text = strings.ReplaceAll(text, "\r\n", "\n")
+	text = strings.TrimRight(text, "\n")
 	lines := strings.Split(text, "\n")
 	var quoted strings.Builder
 	for _, line := range lines {
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139