readthedocs / recommonmark

A markdown parser for docutils
https://recommonmark.readthedocs.io/
MIT License
340 stars 252 forks source link

Bugfix: External links to 'supported' files lose their file extension #181

Closed limasierra closed 4 years ago

limasierra commented 5 years ago

Hi,

This PR fixes the erroneous handling of external links to 'supported' files.

Until now, the extension of every supported type has been stripped.

Adding an additional check ("if not scheme_known") was sufficient to avoid doing this for external links.

Example:

A link to http://example.com/README.md will point to http://example.com/README without this fix, since 'md' is a supported type.

Example 2:

Simply linking to this project's README file is impossible at the moment: https://github.com/readthedocs/recommonmark/blob/master/README.md becomes https://github.com/readthedocs/recommonmark/blob/master/README, which of course doesn't exist.

beckermr commented 4 years ago

@ericholscher any chance this one can be merged?

mzjp2 commented 4 years ago

Quick bump here to ask when this can be merged? :)

timonsku commented 4 years ago

Would it be possible to make a new release with this commit? Quite a few dependants are broken because of it :)

theacodes commented 3 years ago

Gentle nudge here - we'd love a new release.

ericholscher commented 3 years ago

Sorry, I will make sure this happens this week.

theacodes commented 3 years ago

No apologies needed, thank you, Eric!

On Mon, Dec 14, 2020 at 11:08 AM Eric Holscher notifications@github.com wrote:

Sorry, I will make sure this happens this week.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/readthedocs/recommonmark/pull/181#issuecomment-744541617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I42KIEI3CIIOVTVU4W3SUYZ6HANCNFSM4JIVJAWQ .

ericholscher commented 3 years ago

A new version has now been released with this 👍

theacodes commented 3 years ago

Thank you!

On Thu, Dec 17, 2020, 2:26 PM Eric Holscher notifications@github.com wrote:

A new version has now been released with this 👍

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/readthedocs/recommonmark/pull/181#issuecomment-747648803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I4ZLVRJRFOTLA3LYQK3SVJLMPANCNFSM4JIVJAWQ .