@bobfrankston/rmfmail 1.0.658 → 1.0.660

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,10 +65,16 @@ export function buildComposeInit(mode: ComposeMode, accountId: string, original?
65
65
  return init;
66
66
  }
67
67
 
68
+ // Plain-text quoting uses `white-space:pre-wrap` so original line breaks
69
+ // survive but long lines still wrap to the viewport. `<pre>` (the prior
70
+ // approach) was honest about line breaks but disabled wrapping entirely,
71
+ // producing horizontal-scroll quotes that broke the compose layout.
72
+ const PLAIN_QUOTE_STYLE = "white-space:pre-wrap;font-family:inherit;margin:0";
73
+
68
74
  function quoteBody(msg: Message): string {
69
75
  const date = new Date(msg.date).toLocaleString();
70
76
  const from = msg.from.name ? `${msg.from.name} <${msg.from.address}>` : msg.from.address;
71
- const body = msg.bodyHtml || `<pre>${escapeHtml(msg.bodyText)}</pre>`;
77
+ const body = msg.bodyHtml || `<div style="${PLAIN_QUOTE_STYLE}">${escapeHtml(msg.bodyText)}</div>`;
72
78
  return `<br><div class="reply"><p>On ${date}, ${escapeHtml(from)} wrote:</p><blockquote>${body}</blockquote></div>`;
73
79
  }
74
80
 
@@ -76,7 +82,7 @@ function forwardBody(msg: Message): string {
76
82
  const date = new Date(msg.date).toLocaleString();
77
83
  const from = msg.from.name ? `${msg.from.name} <${msg.from.address}>` : msg.from.address;
78
84
  const to = msg.to.map(a => a.name ? `${a.name} <${a.address}>` : a.address).join(", ");
79
- const body = msg.bodyHtml || `<pre>${escapeHtml(msg.bodyText)}</pre>`;
85
+ const body = msg.bodyHtml || `<div style="${PLAIN_QUOTE_STYLE}">${escapeHtml(msg.bodyText)}</div>`;
80
86
  return `<br><div class="reply"><p>---------- Forwarded message ----------<br>From: ${escapeHtml(from)}<br>Date: ${date}<br>Subject: ${escapeHtml(msg.subject)}<br>To: ${escapeHtml(to)}</p>${body}</div>`;
81
87
  }
82
88