mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Merge 5b0f611119 into 04410ff159
This commit is contained in:
commit
e2c29bff52
2 changed files with 23 additions and 1 deletions
|
|
@ -279,7 +279,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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: `<p>‘<a href="http://example.com/">http://example.com/</a>’ “<a href="http://example.com/">http://example.com/</a>”</p>`,
|
||||
},
|
||||
t,
|
||||
)
|
||||
}
|
||||
|
||||
func TestLinkifyWithAllowedProtocols(t *testing.T) {
|
||||
markdown := goldmark.New(
|
||||
goldmark.WithRendererOptions(
|
||||
|
|
|
|||
Loading…
Reference in a new issue