Repository navigation
Conversation
The whitespace stripping added in DockYard#168 was unanchored and removed whitespace before every `=?` in the remainder, so plain text followed by an encoded word lost its separating space (e.g. "a x =?..?=" became "a xb"). Per RFC 2047 §6.2, only linear white space between two adjacent encoded words is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
@andrewtimberlake thoughts? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#168 added whitespace stripping between adjacent RFC 2047 encoded-words, but the regex wasn't anchored. It removed whitespace before every
=?in the rest of the value, so a plain word followed by an encoded-word lost its separating space:Folding isn't the cause. A one-line value like
=?utf-8?Q?a?= x =?utf-8?Q?b?=decoded to"a xb"too.RFC 2047 §6.2 says only linear white space between two adjacent encoded-words is ignored. Whitespace next to ordinary text must stay.
Changes proposed in this pull request
The regex in
parse_encoded_word/2now:\A), i.e. directly after the encoded-word that was just decoded;1*([CRLF] (SP / HTAB)), instead of\s.\salso matches a bare CR, LF, VT or FF;=?charset?[BbQq]?text?=) follows, so a stray=?that isn't an encoded-word keeps the space before it.Tests
"ab": on one line, and folded with a space or a tab (the Ignore space between two encoded words (as per RFC 2047) #168 behaviour).=?.🤖 Generated with Claude Code