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

mailto macro should encode spaces in the URI as %20 instead of + #4576

Closed
mojavelinux opened this issue Apr 12, 2024 · 4 comments
Closed

mailto macro should encode spaces in the URI as %20 instead of + #4576

mojavelinux opened this issue Apr 12, 2024 · 4 comments
Assignees
Labels
bug compliance v2.0.23 Issues resolved in the 2.0.23 release
Milestone

Comments

@mojavelinux
Copy link
Member

According to https://www.rfc-editor.org/rfc/rfc6068#section-5, spaces in the mailto URL should be encoded as %20 instead of +. While some email clients can handle both, others only recognize %20.

@mojavelinux mojavelinux self-assigned this Apr 12, 2024
@mojavelinux mojavelinux added this to the v2.0.x milestone Apr 12, 2024
@mojavelinux
Copy link
Member Author

We have been using CGI.escape, which follows the CGI/HTML forms spec and gives you an application/x-www-form-urlencoded string. What we need to follow is RFC 3986, which requires spaces to be encoded as %20.

@mojavelinux
Copy link
Member Author

"When producing 'mailto' URIs, all spaces SHOULD be encoded as %20, and '+' characters MAY be encoded as %2B."

@mojavelinux
Copy link
Member Author

This is matter of using the new CGI.escapeURIComponent method in Ruby 3.1 and using CGI.escape with a gsub patch for + in Ruby < 3.1.

mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue May 16, 2024
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue May 16, 2024
…cordance with RFC 3986, instead of using +
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue May 16, 2024
…cordance with RFC 3986, instead of using +
@djl101
Copy link
Contributor

djl101 commented May 16, 2024

Thank you for resolving this issue!

@mojavelinux mojavelinux added compliance v2.0.23 Issues resolved in the 2.0.23 release labels May 16, 2024
mojavelinux added a commit that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compliance v2.0.23 Issues resolved in the 2.0.23 release
Projects
None yet
Development

No branches or pull requests

2 participants