@bobfrankston/mailx-imap 0.1.77 → 0.1.78
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/index.js +8 -0
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -119,7 +119,15 @@ async function extractPreview(source) {
|
|
|
119
119
|
// from a Quill compose pasted-image HTML) collapsed to [image] too.
|
|
120
120
|
let raw;
|
|
121
121
|
if (bodyHtml) {
|
|
122
|
+
// Drop the CONTENTS of style/script/head blocks and HTML comments
|
|
123
|
+
// first — a plain tag-strip removes the <style> tags but leaves the
|
|
124
|
+
// CSS rules between them, which then leak into the preview as
|
|
125
|
+
// `*{box-sizing:border-box}` / `@media …{ … }` garbage (Bob's
|
|
126
|
+
// 2026-05-31 marketing-mail shot). Order matters: kill blocks, then
|
|
127
|
+
// images → [image], then any remaining tags.
|
|
122
128
|
raw = bodyHtml
|
|
129
|
+
.replace(/<!--[\s\S]*?-->/g, " ")
|
|
130
|
+
.replace(/<(style|script|head)\b[^>]*>[\s\S]*?<\/\1>/gi, " ")
|
|
123
131
|
.replace(/<img\b[^>]*>/gi, " [image] ")
|
|
124
132
|
.replace(/<[^>]+>/g, " ");
|
|
125
133
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
17
17
|
"@bobfrankston/smtp-direct": "^0.1.8",
|
|
18
18
|
"@bobfrankston/mailx-sync": "^0.1.19",
|
|
19
|
-
"@bobfrankston/oauthsupport": "^1.0.
|
|
19
|
+
"@bobfrankston/oauthsupport": "^1.0.31"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@bobfrankston/tcp-transport": "^0.1.6",
|
|
45
45
|
"@bobfrankston/smtp-direct": "^0.1.8",
|
|
46
46
|
"@bobfrankston/mailx-sync": "^0.1.19",
|
|
47
|
-
"@bobfrankston/oauthsupport": "^1.0.
|
|
47
|
+
"@bobfrankston/oauthsupport": "^1.0.31"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|