diff --git a/renderer/renderer.go b/renderer/renderer.go index 156edef..88cd128 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -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...) }() diff --git a/webbrowser/open_browser_other.go b/webbrowser/open_browser_other.go index 3c64bf2..706953f 100644 --- a/webbrowser/open_browser_other.go +++ b/webbrowser/open_browser_other.go @@ -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") }