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

Links to ids don't produce Markdown links #82

Closed
movermeyer opened this issue Jan 7, 2020 · 3 comments
Closed

Links to ids don't produce Markdown links #82

movermeyer opened this issue Jan 7, 2020 · 3 comments

Comments

@movermeyer
Copy link

When thehref is to an HTML id, no link is generated

link_to_external_site = '<a href="https://example.com#hallo">Hallo!</a>'
link_to_id = '<a href="#hallo">Hallo!</a>'

ReverseMarkdown.convert(link_to_external_site, github_flavored: true, tag_border: '')
=> "[Hallo!](https://example.com#hallo)"

ReverseMarkdown.convert(link_to_id, github_flavored: true, tag_border: '')
=> "Hallo!"

In the second case, I expected [Hallo!](#hallo), not Hallo!.

@movermeyer
Copy link
Author

Looking into this further, it seems that this was intended behaviour at one point:

I'd like to argue that this is the wrong behaviour. Markdown/CommonMark supports jump links (see this file's table of contents for example) and the CommonMark spec allows for any characters in the link destination, including fragments

@xijo
Copy link
Owner

xijo commented Jan 7, 2020

Hi,

Thanks for reporting. Sounds right: jump marks should work as you'd expect them to. I'll have a look and get back to you alright?

Cheers,
Jo

@xijo
Copy link
Owner

xijo commented Jan 7, 2020

Released as 1.4.0. Thanks again!

@xijo xijo closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants