[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime d52a7b52b6 114/118: fixed revert plain text email
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime d52a7b52b6 114/118: fixed revert plain text email bug |
Date: |
Wed, 5 Jan 2022 07:58:51 -0500 (EST) |
branch: elpa/org-mime
commit d52a7b52b652bb87a82be02f66ba14d54dee0cb5
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
fixed revert plain text email bug
---
org-mime.el | 4 +++-
test/org-mime-tests.el | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/org-mime.el b/org-mime.el
index 8edc2e67bd..18ee99f33c 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -850,7 +850,7 @@ Following headline properties can determine the mail
headers.
(defun org-mime-revert-to-plain-text-mail ()
"Revert mail body to plain text."
(interactive)
- (let* ((txt-sep "<#part type=text/plain")
+ (let* ((txt-sep "<#part type=text/plain>")
(html-sep "<#part type=text/html>")
mail-beg
mail-text
@@ -868,6 +868,8 @@ Following headline properties can determine the mail
headers.
(- txt-end (length
html-sep))))
;; delete html mail
(delete-region mail-beg (point-max))
+ (when org-mime-debug
+ (message "mail-beg=%s mail-text=%s" mail-beg mail-text))
;; restore text mail
(insert mail-text))
(t
diff --git a/test/org-mime-tests.el b/test/org-mime-tests.el
index ff99255165..6a17aeac84 100644
--- a/test/org-mime-tests.el
+++ b/test/org-mime-tests.el
@@ -317,4 +317,22 @@
(should (string= (nth 0 (plist-get tags :secure-tags))
"<#secure method=pgpmime mode=sign>"))))
+(ert-deftest test-org-mime-revert-to-plain-text ()
+ (with-temp-buffer
+ (insert
+ "--text follows this line--"
+ "<#multipart type=alternative>\n"
+ "<#part type=text/plain>\n"
+ "test\n"
+ "hello\n"
+ "<#part type=text/html>\n"
+ "<p>\n"
+ "test\n"
+ "hello\n"
+ "</p>\n"
+ "<#/multipart>\n")
+ (message-mode)
+ (org-mime-revert-to-plain-text-mail)
+ (should (string= (string-trim (buffer-string))
+ "--text follows this line--\ntest\nhello"))))
(ert-run-tests-batch-and-exit)
- [nongnu] elpa/org-mime 1162095645 086/118: Catch signature in html convert, (continued)
- [nongnu] elpa/org-mime 1162095645 086/118: Catch signature in html convert, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 722a295672 088/118: Merge pull request #48 from ahttraga/sigfix, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 168fe3a6a1 092/118: Merge pull request #51 from borwickatuw/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 4e5d50789b 097/118: Clean up name of test file in comment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 73fdd3f40d 098/118: Merge pull request #53 from tomheon/clean-up-test-header, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d71f57dc0d 096/118: Add a simple test for quoting of multi-line paragraphs, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5df12989cd 101/118: clean code, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d725955399 105/118: stop bundling htmlize, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e5345ae5b6 104/118: fixed ci, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 23cc52bb53 111/118: donot htmlize security signature and attachment, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime d52a7b52b6 114/118: fixed revert plain text email bug,
ELPA Syncer <=
- [nongnu] elpa/org-mime b1fc1cc53c 116/118: Fix byte-compiler warnings, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 613969effc 118/118: Merge pull request #67 from skangas/silence-byte-compiler, ELPA Syncer, 2022/01/05