Skip to content

Commit

Permalink
Fix bugs from package renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfeller committed Mar 7, 2025
1 parent 00be578 commit 33a6677
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/markdown/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/cli/glamour"
"github.com/cli/go-gh/v2/pkg/accessibility"
"github.com/cli/go-gh/v2/pkg/x/color"
)

// WithoutIndentation is a rendering option that removes indentation from the markdown rendering.
Expand Down Expand Up @@ -34,7 +34,7 @@ func WithWrap(w int) glamour.TermRendererOption {
// If the environment variable GLAMOUR_STYLE is set, it will take precedence over the provided theme.
func WithTheme(theme string) glamour.TermRendererOption {
style := os.Getenv("GLAMOUR_STYLE")
accessible := accessibility.IsAccessibleColorsEnabled()
accessible := color.IsAccessibleColorsEnabled()
if style == "" || style == "auto" {
switch theme {
case "light", "dark":
Expand Down
6 changes: 3 additions & 3 deletions pkg/markdown/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/MakeNowJust/heredoc"
"github.com/alecthomas/chroma/v2/styles"
"github.com/cli/go-gh/v2/pkg/accessibility"
"github.com/cli/go-gh/v2/pkg/x/color"
ansi "github.com/leaanthony/go-ansi-parser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -133,7 +133,7 @@ func Test_RenderAccessible(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if tt.accessible {
t.Setenv(accessibility.AccessibleColorsEnv, "true")
t.Setenv(color.AccessibleColorsEnv, "true")
}

out, err := Render(tt.text, WithTheme(tt.theme))
Expand Down Expand Up @@ -247,7 +247,7 @@ func Test_RenderColor(t *testing.T) {
// Chroma caches charm style used to render codeblocks, it must be unregistered to avoid previously used style being reused.
delete(styles.Registry, "charm")
})
t.Setenv(accessibility.AccessibleColorsEnv, tt.accessibleEnvVar)
t.Setenv(color.AccessibleColorsEnv, tt.accessibleEnvVar)

if tt.styleEnvVar != "" {
path := filepath.Join(t.TempDir(), fmt.Sprintf("%s.json", tt.styleEnvVar))
Expand Down

0 comments on commit 33a6677

Please sign in to comment.