diff --git a/main.go b/main.go index 821423f..a18bf9b 100644 --- a/main.go +++ b/main.go @@ -73,10 +73,22 @@ func highlight(w io.Writer, source, lexer, style string) error { if err != nil { return err } + + /* HACK: If background color is white, set to a reasonable, light grey + * default. */ + if s.Get(chroma.Background).Background.String() == "#ffffff" { + senr := s.Get(chroma.Background) + senr.Background = chroma.ParseColour("#f6f8fa"); + s, err = s.Builder().AddEntry(chroma.Background, senr).Build(); + if err != nil { + return err + } + } + return f.Format(w, s, it) } -const Version = "0.1" +const Version = "0.1.2" func main() { css := flag.String("css", "", "Path to a CSS import to include at the beginning of the output")