mirror of
https://github.com/makew0rld/amfora.git
synced 2024-11-30 15:04:51 +03:00
✨ Italics for quotes - fixes #28
This commit is contained in:
parent
6f1f14a67a
commit
61e54f4b8f
@ -124,18 +124,20 @@ func convertRegularGemini(s string, numLinks int, width int) (string, []string)
|
||||
lines[i] = strings.TrimPrefix(lines[i], ">")
|
||||
lines[i] = strings.TrimPrefix(lines[i], " ")
|
||||
|
||||
// Text is also made italic, lower down in code
|
||||
|
||||
// Anonymous function to allow recovery from potential WordWrap panic
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
// Add unwrapped line instead
|
||||
wrappedLines = append(wrappedLines, "> "+lines[i])
|
||||
wrappedLines = append(wrappedLines, "> [::i]"+lines[i]+"[::-]")
|
||||
}
|
||||
}()
|
||||
|
||||
temp := cview.WordWrap(lines[i], width)
|
||||
for i := range temp {
|
||||
temp[i] = "> " + temp[i]
|
||||
temp[i] = "> [::i]" + temp[i] + "[::-]"
|
||||
}
|
||||
wrappedLines = append(wrappedLines, temp...)
|
||||
}()
|
||||
|
@ -5,5 +5,5 @@ package webbrowser
|
||||
import "fmt"
|
||||
|
||||
func Open(url string) (string, error) {
|
||||
return "", fmt.Errorf("unsupported os for default HTTP handling. Set a command in the config")
|
||||
return "", fmt.Errorf("unsupported OS for default HTTP handling. Set a command in the config")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user