X Tutup
Skip to content

Commit 0cc41b4

Browse files
committed
Provide notty style to glamour when colors are disabled.
1 parent 48e7df2 commit 0cc41b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/utils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ func OpenInBrowser(url string) error {
2222
}
2323

2424
func RenderMarkdown(text string) (string, error) {
25-
return glamour.Render(text, "dark")
25+
style := "notty"
26+
if isColorEnabled() {
27+
style = "dark"
28+
}
29+
return glamour.Render(text, style)
2630
}
2731

2832
func Pluralize(num int, thing string) string {

0 commit comments

Comments
 (0)
X Tutup