mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-03 15:37:17 -04:00
Fix nil pointer access when style is unused
This commit is contained in:
+2
-2
@@ -49,8 +49,8 @@ func renderText(w io.Writer, rules *ElementStyle, s string) {
|
||||
return
|
||||
}
|
||||
|
||||
// FIXME: ugly hack
|
||||
if os.Getenv("COLORTERM") == "truecolor" {
|
||||
// FIXME: ugly true-color ANSI support hack
|
||||
if rules != nil && os.Getenv("COLORTERM") == "truecolor" {
|
||||
bg, err := colorSeq(rules.BackgroundColor)
|
||||
if err == nil {
|
||||
s = "\x1b[48;2;" + bg + s
|
||||
|
||||
Reference in New Issue
Block a user