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

Wrong percent-encoding of unreserved characters #311

Open
DamienCassou opened this issue Jun 3, 2014 · 9 comments
Open

Wrong percent-encoding of unreserved characters #311

DamienCassou opened this issue Jun 3, 2014 · 9 comments
Labels

Comments

@DamienCassou
Copy link

Currently, Markdown percent-encodes unreserved characters. For example, this markdown expression:

[Pillar](http://www.smalltalkhub.com/#!/~Pier/Pillar)

generates

<a href="http://www.smalltalkhub.com/#!/%7EPier/Pillar">Pillar</a>

As you can see, the ~ has been percent-encoded to %7E. Even if this works fine on at least Firefox, this won't work on Chrome:

Click me to verify (works on Firefox 29, does not work on Chromium 34.0.1847.116).

The Percent-encoding page on Wikipedia explains that

For maximum interoperability, URI producers are discouraged from percent-encoding unreserved characters.

On the contrary, the markdown 1.0.1 command-line utility produces the expected, non percent-encoded, HTML:

<a href="http://www.smalltalkhub.com/#!/~Pier/Pillar">Pillar</a>
@bkeepers
Copy link
Contributor

bkeepers commented Jun 3, 2014

/cc @mdiep

@DamienCassou
Copy link
Author

Any news?

@mdiep
Copy link

mdiep commented Aug 26, 2014

That link seems to work fine in Chrome 36.0.1985.143.

@bkeepers
Copy link
Contributor

bkeepers commented Mar 4, 2015

I can confirm that the link works for me as well. Let us know if it doesn't work for you.

@bkeepers bkeepers closed this as completed Mar 4, 2015
@Mouvedia
Copy link

@bkeepers please reopen.
http://www.ietf.org/rfc/rfc3986.txt section 2.3
reproduced on iPad 2 safari 7 (537.51.1) and 45.0.2448.0 chrome canary

In the meantime using <a href=""></a> directly is a quick fix.

@BigEd
Copy link

BigEd commented Nov 14, 2015

I've just been hit by this. Our markdown contains ~, and the HTML contains %7E. Of three browsers tested, two send the %7E to the server and the other url-decodes to ~ before sending. This obscured what was going on. The server then failed to url-decode the %7E. Arguably the server is wrong. But even so, according to the latest applicable RFC, tilde is unreserved, and "Unreserved characters can be escaped without changing the semantics of the URI, but this should not be done unless the URI is being used in a context that does not allow the unescaped character to appear." (http://www.rfc-editor.org/rfc/rfc2396.txt)
The link in question was IBM 5110 Emulator which for me works with Chrome, not with Firefox and not with Safari.

Copy link

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.

@github-actions github-actions bot added the Stale label Dec 21, 2024
@Mouvedia
Copy link

further activity

@github-actions github-actions bot removed the Stale label Dec 22, 2024
Copy link

github-actions bot commented Mar 4, 2025

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.

@github-actions github-actions bot added the Stale label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants