Merge pull request #54 from moorereason/fuzz-more

Fuzz more code paths
This commit is contained in:
Yusuke Inuzuka 2019-12-05 11:17:50 +09:00 committed by GitHub
commit 66aa5562f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,19 +5,28 @@ import (
"github.com/yuin/goldmark" "github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension" "github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer/html" "github.com/yuin/goldmark/renderer/html"
) )
// Fuzz runs automated fuzzing against goldmark. // Fuzz runs automated fuzzing against goldmark.
func Fuzz(data []byte) int { func Fuzz(data []byte) int {
markdown := goldmark.New( markdown := goldmark.New(
goldmark.WithParserOptions(
parser.WithAutoHeadingID(),
parser.WithAttribute(),
),
goldmark.WithRendererOptions( goldmark.WithRendererOptions(
html.WithUnsafe(), html.WithUnsafe(),
html.WithXHTML(),
), ),
goldmark.WithExtensions( goldmark.WithExtensions(
extension.DefinitionList, extension.DefinitionList,
extension.Footnote, extension.Footnote,
extension.GFM, extension.GFM,
extension.Linkify,
extension.Table,
extension.TaskList,
extension.Typographer, extension.Typographer,
), ),
) )