Skip to content

Commit

Permalink
Chore: upgrade go and modules, resolve diagnostic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
teekennedy committed Dec 14, 2024
1 parent 1d79a6d commit 21aa32d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

env:
go_version: 1.21.x
go_version: 1.23.x

jobs:
lint:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/teekennedy/goldmark-markdown

go 1.21
go 1.23.2

require (
github.com/rhysd/go-fakeio v1.0.0
github.com/stretchr/testify v1.7.0
github.com/yuin/goldmark v1.5.4
github.com/yuin/goldmark v1.7.8
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=
github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
4 changes: 2 additions & 2 deletions renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (r *Renderer) renderHeading(node ast.Node, entering bool) ast.WalkStatus {
return r.renderSetextHeading(n, entering)
}
// Otherwise it's up to the configuration
if r.config.HeadingStyle.IsSetext() {
if r.config.IsSetext() {
return r.renderSetextHeading(n, entering)
}
return r.renderATXHeading(n, entering)
Expand Down Expand Up @@ -230,7 +230,7 @@ func (r *Renderer) renderThematicBreak(node ast.Node, entering bool) ast.WalkSta

func (r *Renderer) renderCodeBlock(node ast.Node, entering bool) ast.WalkStatus {
if entering {
r.rc.writer.PushPrefix(r.config.IndentStyle.Bytes())
r.rc.writer.PushPrefix(r.config.Bytes())
r.renderLines(node, entering)
} else {
r.rc.writer.PopPrefix()
Expand Down
12 changes: 5 additions & 7 deletions renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ import (
"github.com/yuin/goldmark/util"
)

var (
transformer = testHelperASTTransformer{}
md = goldmark.New(
goldmark.WithRenderer(NewRenderer()),
goldmark.WithParserOptions(parser.WithASTTransformers(util.Prioritized(&transformer, 0))),
)
)
var transformer = testHelperASTTransformer{}

// testHelperASTTransformer is a goldmark AST transformer that helps with debugging failed tests.
type testHelperASTTransformer struct {
Expand Down Expand Up @@ -79,6 +73,10 @@ func TestCustomRenderers(t *testing.T) {

// TestRenderedOutput tests that the renderer produces the expected output for all test cases
func TestRenderedOutput(t *testing.T) {
md := goldmark.New(
goldmark.WithRenderer(NewRenderer()),
goldmark.WithParserOptions(parser.WithASTTransformers(util.Prioritized(&transformer, 0))),
)
testCases := []struct {
name string
options []Option
Expand Down

0 comments on commit 21aa32d

Please sign in to comment.