@bobfrankston/mailx-imap 0.1.55 → 0.1.56

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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { createAutoImapConfig, CompatImapClient } from "@bobfrankston/iflow-direct";
7
7
  import { authenticateOAuth } from "@bobfrankston/oauthsupport";
8
- import { parseSerial, storeBus } from "@bobfrankston/mailx-store";
8
+ import { parseSerial, fixCharsetDeclString, storeBus } from "@bobfrankston/mailx-store";
9
9
  import { loadSettings, getConfigDir, getHistoryDays, getPrefetch } from "@bobfrankston/mailx-settings";
10
10
  import { EventEmitter } from "node:events";
11
11
  import * as fs from "node:fs";
@@ -106,7 +106,11 @@ function decodeEntities(text) {
106
106
  /** Extract a plain-text preview from message source */
107
107
  async function extractPreview(source) {
108
108
  try {
109
- const parsed = await parseSerial(source, "background");
109
+ // Normalize iso-8859-1 windows-1252 in the part charset declaration
110
+ // before parsing, so the preview decodes 0x80-0x9F (smart quotes,
111
+ // em-dash) correctly — same correction the viewer path gets via
112
+ // sniffAndFixCharset (Bob 2026-05-22).
113
+ const parsed = await parseSerial(fixCharsetDeclString(source), "background");
110
114
  const bodyText = parsed.text || "";
111
115
  const bodyHtml = parsed.html || "";
112
116
  // Use text part; fall back to stripping HTML tags if text is empty
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@bobfrankston/mailx-types": "^0.1.18",
13
13
  "@bobfrankston/mailx-settings": "^0.1.22",
14
- "@bobfrankston/mailx-store": "^0.1.32",
14
+ "@bobfrankston/mailx-store": "^0.1.33",
15
15
  "@bobfrankston/iflow-direct": "^0.1.50",
16
16
  "@bobfrankston/tcp-transport": "^0.1.6",
17
17
  "@bobfrankston/smtp-direct": "^0.1.8",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@bobfrankston/mailx-types": "^0.1.18",
41
41
  "@bobfrankston/mailx-settings": "^0.1.22",
42
- "@bobfrankston/mailx-store": "^0.1.32",
42
+ "@bobfrankston/mailx-store": "^0.1.33",
43
43
  "@bobfrankston/iflow-direct": "^0.1.50",
44
44
  "@bobfrankston/tcp-transport": "^0.1.6",
45
45
  "@bobfrankston/smtp-direct": "^0.1.8",