yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

Bad href attribute when linkify and typographer extensions are enabled #335

Open jmooring opened 2 years ago

jmooring commented 2 years ago

What version of goldmark are you using? : 1.5.2 What version of Go are you using? : 1.19.3 What operating system and processor architecture are you using? : linux/amd64

code ```go package main import ( "bytes" "fmt" "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" ) func main() { md := goldmark.New( goldmark.WithExtensions( extension.Typographer, extension.Linkify, ), ) input := `"https://example.org/"` var buf bytes.Buffer if err := md.Convert([]byte(input), &buf); err != nil { panic(err) } fmt.Println(buf.String()) } ```

Expected output:

<p>&ldquo;<a href="https://example.org/">https://example.org/</a>&rdquo;</p>

Actual output:

<p>&ldquo;<a href="https://example.org/%22">https://example.org/&quot;</a></p>

The behavior is triggered by the trailing slash in the URL.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jmooring commented 1 year ago

Keep, pending response to https://github.com/github/cmark-gfm/issues/297.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

jmooring commented 9 months ago

At this point it is unlikely that anyone will respond to https://github.com/github/cmark-gfm/issues/297#issue-1474072798.

I would either mirror the reference implementation (which will provide GFM compatibility) or close this issue. I'm fine either way.

mwat56 commented 7 months ago

Ping