Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jmooring opened this issue Nov 3, 2022 · 6 comments
Open
Labels
pinned issue should not be closed by stalebot

Comments

@jmooring
Copy link
Contributor

jmooring commented Nov 3, 2022

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
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
Copy link

stale bot commented Jan 7, 2023

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.

@stale stale bot added the stale label Jan 7, 2023
@jmooring
Copy link
Contributor Author

jmooring commented Jan 7, 2023

Keep, pending response to github/cmark-gfm#297.

@stale stale bot removed the stale label Jan 7, 2023
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label May 29, 2023
@github-actions
Copy link

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

@yuin yuin added pinned issue should not be closed by stalebot and removed stale labels Jun 13, 2023
@yuin yuin reopened this Jun 13, 2023
@jmooring
Copy link
Contributor Author

At this point it is unlikely that anyone will respond to github/cmark-gfm#297 (comment).

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

@mwat56
Copy link

mwat56 commented Mar 15, 2024

Ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned issue should not be closed by stalebot
Projects
None yet
Development

No branches or pull requests

3 participants