Skip to content

Commit

Permalink
Add support for goldmark-pikchr
Browse files Browse the repository at this point in the history
  • Loading branch information
zellyn committed Jan 30, 2022
1 parent 5ca40c8 commit 87bbe9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ resources/sunset.jpg

vendor

.hugo_build.lock
public/
5 changes: 5 additions & 0 deletions markup/goldmark/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/gohugoio/hugo/markup/converter"
"github.com/gohugoio/hugo/markup/highlight"
"github.com/gohugoio/hugo/markup/tableofcontents"
"github.com/gopikchr/goldmark-pikchr"
"github.com/yuin/goldmark"
hl "github.com/yuin/goldmark-highlighting"
"github.com/yuin/goldmark/extension"
Expand Down Expand Up @@ -136,6 +137,10 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
extensions = append(extensions, extension.Footnote)
}

if cfg.Extensions.Pikchr {
extensions = append(extensions, &pikchr.Extender{})
}

if cfg.Parser.AutoHeadingID {
parserOptions = append(parserOptions, parser.WithAutoHeadingID())
}
Expand Down
3 changes: 3 additions & 0 deletions markup/goldmark/goldmark_config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type Extensions struct {
Strikethrough bool
Linkify bool
TaskList bool

// Extra extensions
Pikchr bool
}

type Renderer struct {
Expand Down

0 comments on commit 87bbe9f

Please sign in to comment.