diff --git a/extension/linkify.go b/extension/linkify.go index 2f046eb..7ede216 100644 --- a/extension/linkify.go +++ b/extension/linkify.go @@ -277,7 +277,7 @@ func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Cont for ; i > 0; i-- { c := line[i] switch c { - case '?', '!', '.', ',', ':', '*', '_', '~': + case '?', '!', '.', ',', ':', '*', '_', '~', '\'', '"': default: goto endfor } diff --git a/extension/linkify_test.go b/extension/linkify_test.go index d096aca..5f32c65 100644 --- a/extension/linkify_test.go +++ b/extension/linkify_test.go @@ -21,6 +21,28 @@ func TestLinkify(t *testing.T) { testutil.DoTestCaseFile(markdown, "_test/linkify.txt", t, testutil.ParseCliCaseArg()...) } +func TestLinkifyWithTypographer(t *testing.T) { + markdown := goldmark.New( + goldmark.WithRendererOptions( + html.WithUnsafe(), + ), + goldmark.WithExtensions( + Linkify, + Typographer, + ), + ) + + testutil.DoTestCase( + markdown, + testutil.MarkdownTestCase{ + No: 1, + Markdown: `'http://example.com/' "http://example.com/"`, + Expected: `

http://example.com/’ “http://example.com/

`, + }, + t, + ) +} + func TestLinkifyWithAllowedProtocols(t *testing.T) { markdown := goldmark.New( goldmark.WithRendererOptions(