@bobfrankston/rmfmail 1.0.676 → 1.0.678
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.
- package/TODO.md +11 -1
- package/bin/build-spellcheck-dict.js +25 -0
- package/client/app.bundle.js +16 -19
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +34 -22
- package/client/app.js.map +1 -1
- package/client/app.ts +34 -24
- package/client/components/calendar-sidebar.js +14 -1
- package/client/components/calendar-sidebar.js.map +1 -1
- package/client/components/calendar-sidebar.ts +13 -1
- package/client/compose/compose.bundle.js +1254 -4
- package/client/compose/compose.bundle.js.map +4 -4
- package/client/compose/compose.css +28 -2
- package/client/compose/compose.js +23 -1
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +21 -1
- package/client/compose/spellcheck.js +296 -0
- package/client/compose/spellcheck.js.map +1 -0
- package/client/compose/spellcheck.ts +267 -0
- package/client/lib/dict/en.aff +205 -0
- package/client/lib/dict/en.dic +49569 -0
- package/client/lib/rmf-tiny.js +3 -2
- package/package.json +8 -2
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +9 -1
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +9 -1
package/client/app.js
CHANGED
|
@@ -1084,29 +1084,41 @@ function addComposeResizeHandles(wrapper, frame) {
|
|
|
1084
1084
|
// 30-40px columns inside a phone-width compose pane and wrap text
|
|
1085
1085
|
// character-by-character. Strip styles + flatten tables before quoting.
|
|
1086
1086
|
function sanitizeQuotedBody(msg) {
|
|
1087
|
-
//
|
|
1088
|
-
//
|
|
1089
|
-
//
|
|
1090
|
-
|
|
1087
|
+
// Two-mode quote: plain-text gets a pre-wrap wrapper so line breaks
|
|
1088
|
+
// render as breaks; HTML is preserved verbatim modulo a minimal scrub
|
|
1089
|
+
// for tags that have no legitimate place inside a quoted reply.
|
|
1090
|
+
//
|
|
1091
|
+
// We do NOT strip inline styles, classes, or table attributes any
|
|
1092
|
+
// more — that earlier aggressive strip destroyed 95% of the original
|
|
1093
|
+
// sender's formatting (CSS in email is almost entirely inline; see
|
|
1094
|
+
// discussion 2026-05-11 about how every mail client preserves the
|
|
1095
|
+
// source HTML). Wide content is now clamped via CSS (.reply *
|
|
1096
|
+
// { max-width: 100% } in compose.css) instead of by rewriting the
|
|
1097
|
+
// DOM. Tables stay tables, paragraphs stay paragraphs, font sizes
|
|
1098
|
+
// and colors survive.
|
|
1099
|
+
//
|
|
1100
|
+
// Script-class tags (<script>, <style>, <link>, <base>, on*= attrs,
|
|
1101
|
+
// javascript: URLs) are belt-and-braces — sanitizeHtml in mailx-core
|
|
1102
|
+
// already strips them at body-store time, so msg.bodyHtml shouldn't
|
|
1103
|
+
// contain them. Stripping again here is cheap insurance against a
|
|
1104
|
+
// future provider/path that didn't go through that pipeline.
|
|
1105
|
+
const isPlainText = !msg.bodyHtml;
|
|
1106
|
+
if (isPlainText) {
|
|
1107
|
+
const escaped = String(msg.bodyText || "")
|
|
1108
|
+
.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1109
|
+
return `<div style="white-space:pre-wrap;font-family:inherit;margin:0">${escaped}</div>`;
|
|
1110
|
+
}
|
|
1111
|
+
let body = msg.bodyHtml;
|
|
1112
|
+
// Minimal defense-in-depth strip. <style> blocks would leak global
|
|
1113
|
+
// CSS into the compose document; <link> / <base> would fetch remote
|
|
1114
|
+
// resources; <script> would be inert in contenteditable but the tag
|
|
1115
|
+
// would persist into the sent message which is rude.
|
|
1116
|
+
body = body.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "");
|
|
1091
1117
|
body = body.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "");
|
|
1092
|
-
body = body.replace(
|
|
1093
|
-
body = body.replace(
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
// Store buttons render huge in quoted replies (the source ad had
|
|
1097
|
-
// explicit width="120" height="40" on each image). Q138.
|
|
1098
|
-
body = body.replace(/<(?!img\b)([^>]*?)\s+(width|height|align|valign|bgcolor|cellpadding|cellspacing|border)="[^"]*"([^>]*)>/gi, (_m, before, _attr, after) => `<${before}${after}>`);
|
|
1099
|
-
// Loop until no more matches — a single tag with multiple stripped
|
|
1100
|
-
// attrs needs more than one pass since the regex only handles one
|
|
1101
|
-
// attribute per match.
|
|
1102
|
-
let prev = "";
|
|
1103
|
-
while (prev !== body) {
|
|
1104
|
-
prev = body;
|
|
1105
|
-
body = body.replace(/<(?!img\b)([^>]*?)\s+(width|height|align|valign|bgcolor|cellpadding|cellspacing|border)="[^"]*"([^>]*)>/gi, (_m, before, _attr, after) => `<${before}${after}>`);
|
|
1106
|
-
}
|
|
1107
|
-
body = body.replace(/<table[^>]*>/gi, "<div>").replace(/<\/table>/gi, "</div>");
|
|
1108
|
-
body = body.replace(/<t[rdh][^>]*>/gi, "").replace(/<\/t[rdh]>/gi, " ");
|
|
1109
|
-
body = body.replace(/<thead[^>]*>|<\/thead>|<tbody[^>]*>|<\/tbody>/gi, "");
|
|
1118
|
+
body = body.replace(/<link[^>]*>/gi, "");
|
|
1119
|
+
body = body.replace(/<base[^>]*>/gi, "");
|
|
1120
|
+
body = body.replace(/\s+on\w+="[^"]*"/gi, "");
|
|
1121
|
+
body = body.replace(/\s+on\w+='[^']*'/gi, "");
|
|
1110
1122
|
return body;
|
|
1111
1123
|
}
|
|
1112
1124
|
function quoteBody(msg) {
|