1package common23import (4 gansi "charm.land/glamour/v2/ansi"5 "charm.land/glamour/v2/styles"6 "github.com/charmbracelet/colorprofile"7)89// DefaultColorProfile is the default color profile used by the SSH server.10var DefaultColorProfile = colorprofile.ANSI2561112func strptr(s string) *string {13 return &s14}1516// StyleConfig returns the default Glamour style configuration.17func StyleConfig() gansi.StyleConfig {18 noColor := strptr("")19 s := styles.DarkStyleConfig20 // This fixes an issue with the default style config. For example21 // highlighting empty spaces with red in Dockerfile type.22 s.CodeBlock.Chroma.Error.BackgroundColor = noColor23 return s24}2526// StyleRenderer returns a new Glamour renderer.27func StyleRenderer() gansi.RenderContext {28 return StyleRendererWithStyles(StyleConfig())29}3031// StyleRendererWithStyles returns a new Glamour renderer.32func StyleRendererWithStyles(styles gansi.StyleConfig) gansi.RenderContext {33 return gansi.NewRenderContext(gansi.Options{34 Styles: styles,35 })36}