mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
all: Remove unused code
Using x/tools/cmd/deadcode
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package images
|
||||
|
||||
import (
|
||||
"github.com/yuin/goldmark"
|
||||
"github.com/yuin/goldmark/ast"
|
||||
"github.com/yuin/goldmark/parser"
|
||||
"github.com/yuin/goldmark/text"
|
||||
"github.com/yuin/goldmark/util"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -20,18 +18,6 @@ const (
|
||||
AttrIsBlock = "_h__isBlock"
|
||||
)
|
||||
|
||||
func New(wrapStandAloneImageWithinParagraph bool) goldmark.Extender {
|
||||
return &linksExtension{wrapStandAloneImageWithinParagraph: wrapStandAloneImageWithinParagraph}
|
||||
}
|
||||
|
||||
func (e *linksExtension) Extend(m goldmark.Markdown) {
|
||||
m.Parser().AddOptions(
|
||||
parser.WithASTTransformers(
|
||||
util.Prioritized(&Transformer{wrapStandAloneImageWithinParagraph: e.wrapStandAloneImageWithinParagraph}, 300),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
type Transformer struct {
|
||||
wrapStandAloneImageWithinParagraph bool
|
||||
}
|
||||
@@ -67,7 +53,5 @@ func (t *Transformer) Transform(doc *ast.Document, reader text.Reader, pctx pars
|
||||
}
|
||||
|
||||
return ast.WalkContinue, nil
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
@@ -232,7 +232,6 @@ func highlight(fw hugio.FlexiWriter, code, lang string, attributes []attributes.
|
||||
return ``
|
||||
},
|
||||
}
|
||||
|
||||
} else {
|
||||
wrapper = getPreWrapper(lang, w)
|
||||
}
|
||||
@@ -314,10 +313,6 @@ func (s startEnd) End(code bool) string {
|
||||
return s.end(code)
|
||||
}
|
||||
|
||||
func WritePreEnd(w io.Writer) {
|
||||
fmt.Fprint(w, preEnd)
|
||||
}
|
||||
|
||||
func writeDivStart(w hugio.FlexiWriter, attrs []attributes.Attribute) {
|
||||
w.WriteString(`<div class="highlight`)
|
||||
if attrs != nil {
|
||||
|
Reference in New Issue
Block a user