Skip to content

Commit

Permalink
readme: Update extras extension example
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored May 5, 2024
1 parent b496df9 commit 246e082
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ import (
"fmt"

"github.com/gohugoio/hugo-goldmark-extensions/extras"
"github.com/gohugoio/hugo-goldmark-extensions/extras/ast"
"github.com/yuin/goldmark"
)

func main() {
md := goldmark.New(
goldmark.WithExtensions(
extras.New(extras.Config{InlineTagType: ast.Insert}),
extras.New(extras.Config{InlineTagType: ast.Mark}),
extras.New(extras.Config{InlineTagType: ast.Subscript}),
extras.New(extras.Config{InlineTagType: ast.Superscript}),
))
goldmark.WithExtensions(extras.New(
extras.Config{
Insert: extras.InsertConfig{Enable: true},
Mark: extras.MarkConfig{Enable: true},
Subscript: extras.SubscriptConfig{Enable: true},
Superscript: extras.SuperscriptConfig{Enable: true},
},
)),
)

input := `
Hydrogen (H) is the 1^st^ element in the periodic table.
Expand Down

0 comments on commit 246e082

Please sign in to comment.