-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add emoji support in email subjects #25
Merged
bluekeyes
merged 6 commits into
bluekeyes:master
from
jmcampanini:jc/emoji-subject-support
Jul 19, 2021
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
043c798
add support for emojis in subject line
jmcampanini 8ab13c8
added multiline support
jmcampanini a5d9fc0
improve comments
jmcampanini 304a6dc
use quotedprintable stdlib package
jmcampanini 77e5d9f
swap to use example from git docs
jmcampanini 2797d23
fixup method name and comment
jmcampanini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,8 @@ func TestParsePatchHeader(t *testing.T) { | |
} | ||
expectedDate := time.Date(2020, 04, 11, 15, 21, 23, 0, time.FixedZone("PDT", -7*60*60)) | ||
expectedTitle := "A sample commit to test header parsing" | ||
expectedEmojiOneLineTitle := "🤖 Enabling auto-merging" | ||
expectedEmojiMultiLineTitle := "[IA64] Put ia64 config files on the Uwe Kleine-König diet" | ||
expectedBody := "The medium format shows the body, which\nmay wrap on to multiple lines.\n\nAnother body line." | ||
expectedBodyAppendix := "CC: Joe Smith <[email protected]>" | ||
|
||
|
@@ -267,6 +269,45 @@ Another body line. | |
Body: expectedBody, | ||
}, | ||
}, | ||
"mailboxEmojiOneLine": { | ||
Input: `From 61f5cd90bed4d204ee3feb3aa41ee91d4734855b Mon Sep 17 00:00:00 2001 | ||
From: Morton Haypenny <[email protected]> | ||
Date: Sat, 11 Apr 2020 15:21:23 -0700 | ||
Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Enabling=20auto-merging?= | ||
|
||
The medium format shows the body, which | ||
may wrap on to multiple lines. | ||
|
||
Another body line. | ||
`, | ||
Header: PatchHeader{ | ||
SHA: expectedSHA, | ||
Author: expectedIdentity, | ||
AuthorDate: expectedDate, | ||
Title: expectedEmojiOneLineTitle, | ||
Body: expectedBody, | ||
}, | ||
}, | ||
"mailboxEmojiMultiLine": { | ||
Input: `From 61f5cd90bed4d204ee3feb3aa41ee91d4734855b Mon Sep 17 00:00:00 2001 | ||
From: Morton Haypenny <[email protected]> | ||
Date: Sat, 11 Apr 2020 15:21:23 -0700 | ||
Subject: [PATCH] =?UTF-8?q?[IA64]=20Put=20ia64=20config=20files=20on=20the=20?= | ||
=?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20diet?= | ||
|
||
The medium format shows the body, which | ||
may wrap on to multiple lines. | ||
|
||
Another body line. | ||
`, | ||
Header: PatchHeader{ | ||
SHA: expectedSHA, | ||
Author: expectedIdentity, | ||
AuthorDate: expectedDate, | ||
Title: expectedEmojiMultiLineTitle, | ||
Body: expectedBody, | ||
}, | ||
}, | ||
"mailboxAppendix": { | ||
Input: `From 61f5cd90bed4d204ee3feb3aa41ee91d4734855b Mon Sep 17 00:00:00 2001 | ||
From: Morton Haypenny <[email protected]> | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call this
decodeSubject
so it could be expanded for more encodings, either now or in the future.