[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-mime dc7ae1de85 094/118: Show individual paragraphs in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-mime dc7ae1de85 094/118: Show individual paragraphs in gmail reply quotes |
Date: |
Wed, 5 Jan 2022 07:58:50 -0500 (EST) |
branch: elpa/org-mime
commit dc7ae1de8564399fb706b18e7c8cacf044fcccb5
Author: Edmund Jorgensen <tomheon@gmail.com>
Commit: Edmund Jorgensen <tomheon@gmail.com>
Show individual paragraphs in gmail reply quotes
Prior to this patch, replies using the org-mime-beautify-quoted-mail option
would show up with multiple paragraphs in the reply squashed onto a single
line (at least in gmail).
For example, the reply:
```
> This is one para (which is
> split across two lines)
>
> This is another
```
Would get rendered as:
```
<p>
This is one para (which is
split across two lines)
This is another
</p>
```
And displayed in gmail as:
```
| This is one para (which is split across two lines) This is another
```
(Where '|' is the beautifed vertical line in gmail.)
Looking at how gmail itself deals with multiple paras in a reply, it appears
they:
1. put each paragraph in its own div
2. represent blank lines between divs as <br />
They do some funky nesting that doesn't seem to be needed to make the quotes
display correctly, so I've left it out.
This patch would render the example above into the structure:
```
<div>This is one para (which is
split across two lines)</div>
<div><br/></div>
<div>This is another</div>
```
(With some less beautiful line breaks) and displayed in gmail as:
```
| This is one para (which is split across two lines)
|
| This is another
```
To better represent the gmail de-factor standard, this patch also changes
the
top-level element in the gmail blockquote to div (from p).
---
org-mime.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/org-mime.el b/org-mime.el
index 45c3404a02..67ee5bbfc7 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -294,8 +294,9 @@ OPTS is export options."
HTML is the body of the message."
(let ((quote-depth 0)
(line-depth 0)
- (quote-opening "<blockquote class=\"gmail_quote\" style=\"margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex\">\n<p>\n")
- (quote-closing "</p>\n</blockquote>\n"))
+ (in-quote-p nil)
+ (quote-opening "<blockquote class=\"gmail_quote\" style=\"margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex\">\n\n<div>")
+ (quote-closing "\n</div></blockquote>\n"))
(with-temp-buffer
;; clean title of quoted
(insert (replace-regexp-in-string
@@ -305,7 +306,9 @@ HTML is the body of the message."
(goto-char (point-min))
(while (not (eobp))
(setq line-depth 0)
+ (setq in-quote-p nil)
(while (looking-at ">[ \t]*")
+ (setq in-quote-p t)
(replace-match "")
(cl-incf line-depth))
(cond
@@ -317,7 +320,13 @@ HTML is the body of the message."
(while (> quote-depth line-depth)
(insert quote-closing)
(cl-decf quote-depth))))
- (forward-line))
+ (if (and in-quote-p (looking-at "^[ \t]*$"))
+ (progn
+ (insert "</div>\n<div>")
+ (forward-line)
+ (insert "<br />")
+ (insert "</div>\n<div>"))
+ (forward-line)))
(buffer-substring (point-min) (point-max)))))
(defun org-mime-multipart (plain html &optional images)
- [nongnu] elpa/org-mime 3b119a22be 112/118: handle file url on Windows elegantly, (continued)
- [nongnu] elpa/org-mime 3b119a22be 112/118: handle file url on Windows elegantly, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime f7a45f5573 115/118: Upgrade test file to GPLv3, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 77c3f07ce4 046/118: documentation, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e5c68b1c66 044/118: minor changes to docstrings for readability and style changes., ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime e35c367e7d 048/118: clean code, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 41ea9818b4 050/118: fix cc, bcc compiling error, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0db41d5b4e 065/118: emergency fix of broken 0.1.4, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 470808cc14 070/118: Added support for MAIL_FROM property, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 5132ec0586 089/118: Improve signature separator regex, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 744f5f3315 090/118: Merge pull request #49 from ahttraga/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dc7ae1de85 094/118: Show individual paragraphs in gmail reply quotes,
ELPA Syncer <=
- [nongnu] elpa/org-mime 85c98739f3 001/118: import original org-mime, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8d7797ea07 007/118: clean code according to org review, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime b33c96b2d0 015/118: embedded image could use absolute path, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime dd1b9881af 027/118: remove drawers when org-mime-htmlize-subtree at emacs 24.3, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 8067e76eb1 029/118: add documentation on embedded image, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 80b4e3a3b4 008/118: add readme, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime fb265448df 038/118: Merge pull request #14 from unhammer/issue13-OPTIONS-noise, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime 0752659f7a 042/118: No drawer exporting (default since Emacs 25), ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime db707a7337 040/118: Merge pull request #15 from unhammer/patch-1, ELPA Syncer, 2022/01/05
- [nongnu] elpa/org-mime bc61d4de7d 045/118: Merge pull request #18 from jkitchin/master, ELPA Syncer, 2022/01/05