aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-01-28 22:34:10 +0100
committerBjørn Erik Pedersen <[email protected]>2024-01-28 23:14:09 +0100
commita795acbcd8b18aa4af384d5c03f30740361c8fcf (patch)
tree0dbf7b000681a738b892c5235daf52c63cda88b9 /markup
parent982d9513e71b3d48e20cfa38454a0e1215a8d963 (diff)
downloadhugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.tar.gz
hugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.zip
all: Run gofumpt -l -w .
Diffstat (limited to 'markup')
-rw-r--r--markup/goldmark/images/transform.go2
-rw-r--r--markup/goldmark/internal/extensions/attributes/attributes.go4
-rw-r--r--markup/internal/external.go3
-rw-r--r--markup/markup_config/config_test.go2
-rw-r--r--markup/pandoc/convert.go3
-rw-r--r--markup/rst/convert.go3
-rw-r--r--markup/tableofcontents/tableofcontents_test.go2
7 files changed, 6 insertions, 13 deletions
diff --git a/markup/goldmark/images/transform.go b/markup/goldmark/images/transform.go
index 4eb793ae1..2e97a6791 100644
--- a/markup/goldmark/images/transform.go
+++ b/markup/goldmark/images/transform.go
@@ -71,7 +71,5 @@ func (t *Transformer) Transform(doc *ast.Document, reader text.Reader, pctx pars
}
return ast.WalkContinue, nil
-
})
-
}
diff --git a/markup/goldmark/internal/extensions/attributes/attributes.go b/markup/goldmark/internal/extensions/attributes/attributes.go
index 60ae609ec..feb3d915b 100644
--- a/markup/goldmark/internal/extensions/attributes/attributes.go
+++ b/markup/goldmark/internal/extensions/attributes/attributes.go
@@ -56,7 +56,7 @@ func (a *attrParser) Continue(node ast.Node, reader text.Reader, pc parser.Conte
func (a *attrParser) Open(parent ast.Node, reader text.Reader, pc parser.Context) (ast.Node, parser.State) {
if attrs, ok := parser.ParseAttributes(reader); ok {
// add attributes
- var node = &attributesBlock{
+ node := &attributesBlock{
BaseBlock: ast.BaseBlock{},
}
for _, attr := range attrs {
@@ -95,7 +95,7 @@ func (a *attributesBlock) Kind() ast.NodeKind {
type transformer struct{}
func (a *transformer) Transform(node *ast.Document, reader text.Reader, pc parser.Context) {
- var attributes = make([]ast.Node, 0, 500)
+ attributes := make([]ast.Node, 0, 500)
ast.Walk(node, func(node ast.Node, entering bool) (ast.WalkStatus, error) {
if entering && node.Kind() == kindAttributesBlock {
// Attributes for fenced code blocks are handled in their own extension,
diff --git a/markup/internal/external.go b/markup/internal/external.go
index 97cf5cc7d..dc8cc61c2 100644
--- a/markup/internal/external.go
+++ b/markup/internal/external.go
@@ -13,7 +13,8 @@ import (
func ExternallyRenderContent(
cfg converter.ProviderConfig,
ctx converter.DocumentContext,
- content []byte, binaryName string, args []string) ([]byte, error) {
+ content []byte, binaryName string, args []string,
+) ([]byte, error) {
logger := cfg.Logger
if strings.Contains(binaryName, "/") {
diff --git a/markup/markup_config/config_test.go b/markup/markup_config/config_test.go
index 782cedbc9..5169bd79f 100644
--- a/markup/markup_config/config_test.go
+++ b/markup/markup_config/config_test.go
@@ -83,7 +83,5 @@ func TestConfig(t *testing.T) {
c.Assert(err, qt.IsNil)
c.Assert(conf.Goldmark.Extensions.Typographer.Disable, qt.Equals, false)
c.Assert(conf.Goldmark.Extensions.Typographer.Ellipsis, qt.Equals, "&hellip;")
-
})
-
}
diff --git a/markup/pandoc/convert.go b/markup/pandoc/convert.go
index eaa9bfb6a..8f2d99c9a 100644
--- a/markup/pandoc/convert.go
+++ b/markup/pandoc/convert.go
@@ -26,8 +26,7 @@ import (
// Provider is the package entry point.
var Provider converter.ProviderProvider = provider{}
-type provider struct {
-}
+type provider struct{}
func (p provider) New(cfg converter.ProviderConfig) (converter.Provider, error) {
return converter.NewProvider("pandoc", func(ctx converter.DocumentContext) (converter.Converter, error) {
diff --git a/markup/rst/convert.go b/markup/rst/convert.go
index b7aa5a2ce..398f5eb0c 100644
--- a/markup/rst/convert.go
+++ b/markup/rst/convert.go
@@ -30,8 +30,7 @@ import (
// Provider is the package entry point.
var Provider converter.ProviderProvider = provider{}
-type provider struct {
-}
+type provider struct{}
func (p provider) New(cfg converter.ProviderConfig) (converter.Provider, error) {
return converter.NewProvider("rst", func(ctx converter.DocumentContext) (converter.Converter, error) {
diff --git a/markup/tableofcontents/tableofcontents_test.go b/markup/tableofcontents/tableofcontents_test.go
index ac9ad0eed..3af9c4eb6 100644
--- a/markup/tableofcontents/tableofcontents_test.go
+++ b/markup/tableofcontents/tableofcontents_test.go
@@ -186,7 +186,6 @@ func TestTocMisc(t *testing.T) {
}
func BenchmarkToc(b *testing.B) {
-
newTocs := func(n int) []*Fragments {
var tocs []*Fragments
for i := 0; i < n; i++ {
@@ -216,5 +215,4 @@ func BenchmarkToc(b *testing.B) {
toc.ToHTML(1, -1, false)
}
})
-
}