template: remove last \n to fix additional new lines after quote
This commit is contained in:
parent
d238272bdb
commit
fe9ec67eca
1 changed files with 2 additions and 0 deletions
|
@ -97,6 +97,7 @@ func wrapLine(text string, lineWidth int) string {
|
||||||
|
|
||||||
func wrapText(text string, lineWidth int) string {
|
func wrapText(text string, lineWidth int) string {
|
||||||
text = strings.ReplaceAll(text, "\r\n", "\n")
|
text = strings.ReplaceAll(text, "\r\n", "\n")
|
||||||
|
text = strings.TrimRight(text, "\n")
|
||||||
lines := strings.Split(text, "\n")
|
lines := strings.Split(text, "\n")
|
||||||
var wrapped strings.Builder
|
var wrapped strings.Builder
|
||||||
|
|
||||||
|
@ -118,6 +119,7 @@ func wrapText(text string, lineWidth int) string {
|
||||||
// quote prepends "> " in front of every line in text
|
// quote prepends "> " in front of every line in text
|
||||||
func quote(text string) string {
|
func quote(text string) string {
|
||||||
text = strings.ReplaceAll(text, "\r\n", "\n")
|
text = strings.ReplaceAll(text, "\r\n", "\n")
|
||||||
|
text = strings.TrimRight(text, "\n")
|
||||||
lines := strings.Split(text, "\n")
|
lines := strings.Split(text, "\n")
|
||||||
var quoted strings.Builder
|
var quoted strings.Builder
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
|
|
Loading…
Reference in a new issue