mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
🐛 Empty quote lines don't disappear
This commit is contained in:
parent
1b92bc9bc4
commit
9ad3dd82a0
@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Downloading now uses proxies when appropriate
|
||||
- User-entered URLs with invalid characters will be percent-encoded (#138)
|
||||
- Custom downloads dir is actually used (#148)
|
||||
- Empty quote lines no longer disappear
|
||||
|
||||
|
||||
## [1.6.0] - 2020-11-04
|
||||
|
@ -243,13 +243,18 @@ func convertRegularGemini(s string, numLinks, width int, proxied bool) (string,
|
||||
} else if strings.HasPrefix(lines[i], ">") {
|
||||
// It's a quote line, add extra quote symbols and italics to the start of each wrapped line
|
||||
|
||||
// Remove beginning quote and maybe space
|
||||
lines[i] = strings.TrimPrefix(lines[i], ">")
|
||||
lines[i] = strings.TrimPrefix(lines[i], " ")
|
||||
wrappedLines = append(wrappedLines,
|
||||
wrapLine(lines[i], width, fmt.Sprintf("[%s::i]> ", config.GetColorString("quote_text")),
|
||||
"[-::-]", true)...,
|
||||
)
|
||||
if len(lines[i]) == 1 {
|
||||
// Just an empty quote line
|
||||
wrappedLines = append(wrappedLines, fmt.Sprintf("[%s::i]>[-::-]", config.GetColorString("quote_text")))
|
||||
} else {
|
||||
// Remove beginning quote and maybe space
|
||||
lines[i] = strings.TrimPrefix(lines[i], ">")
|
||||
lines[i] = strings.TrimPrefix(lines[i], " ")
|
||||
wrappedLines = append(wrappedLines,
|
||||
wrapLine(lines[i], width, fmt.Sprintf("[%s::i]> ", config.GetColorString("quote_text")),
|
||||
"[-::-]", true)...,
|
||||
)
|
||||
}
|
||||
|
||||
} else if strings.TrimSpace(lines[i]) == "" {
|
||||
// Just add empty line without processing
|
||||
|
Loading…
Reference in New Issue
Block a user