Skip to content

Commit

Permalink
✨ Italics for quotes - fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Jul 2, 2020
1 parent 6f1f14a commit 61e54f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions renderer/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}()
Expand Down
2 changes: 1 addition & 1 deletion webbrowser/open_browser_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 61e54f4

Please sign in to comment.