Skip to content

Preserve literal plus signs when rendering mailto text - #253

Open
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/mailto-uri
Open

Preserve literal plus signs when rendering mailto text#253
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/mailto-uri

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Decode mailto components using URI percent decoding, preserving literal plus signs. Form decoding incorrectly treats + as a space in recipients, header names/values and body.

Reproduction

URI('mailto:a+b@example.test?subject=a+b&body=x+y').to_mailtext currently renders a space in each plus position. Afterward it preserves a+b and x+y. %2B still decodes to plus and %20 to space. RFC 6068 section 2 permits literal plus in mailto components.

Verification

  • Ruby 4.0.6 through rbenv; existing bundle exec rake test: 93 tests / 3,039 assertions / zero failures or errors, both baseline and this isolated patch.
  • 6 full-output checks cover literal plus, encoded plus and encoded spaces across the recipient, additional to field, subject, custom header and body, including the to_rfc822text alias.
  • Syntax and git diff --check pass. Supplemental Lint adds no findings against the 31-finding baseline.
  • No test/spec files added or modified, per this contribution's explicit no-new-tests constraint. Focused reproductions ran externally.

Compatibility and limitations

Intentional correction: literal plus no longer becomes a space. This does not change header-case handling or broader mailto parsing. No public API removal, dependency change or Ruby minimum change.

Based on master 696df43b0be4c05d3a0dcf7db582126c915d860d. Other Ruby/OS runtimes were not executed locally. No production traffic or live mail/FTP services were used. Existing related PRs/issues were checked; this is a focused contribution, not exhaustive behavioral coverage.

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

Successfully merging this pull request may close these issues.

1 participant