From e6747ee62878f45862749f5c70b67875b8666287 Mon Sep 17 00:00:00 2001 From: jkboxomine <28672313+jkboxomine@users.noreply.github.com> Date: Fri, 6 Dec 2019 00:11:32 +0900 Subject: [PATCH] Update test case for auto heading ID generation - remove WithIDs option - add test cases with international characters and other conditions --- extra_test.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/extra_test.go b/extra_test.go index bddfe3f..6775ec2 100644 --- a/extra_test.go +++ b/extra_test.go @@ -71,17 +71,29 @@ func (s *myIDs) Put(value []byte) { } func TestAutogeneratedIDs(t *testing.T) { - ctx := parser.NewContext(parser.WithIDs(&myIDs{})) + ctx := parser.NewContext() markdown := New(WithParserOptions(parser.WithAutoHeadingID())) - source := []byte("# Title1\n## Title2") + + source := []byte("## Não há quem goste de dor") var b bytes.Buffer err := markdown.Convert(source, &b, parser.WithContext(ctx)) if err != nil { t.Error(err.Error()) } - if b.String() != `