@social-mail/social-mail-web-server 1.8.40 → 1.8.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.40",
3
+ "version": "1.8.41",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -40,10 +40,16 @@ export const Convert = {
40
40
  if (args[1] === "txt") {
41
41
  // txt hangs, so lets use to html and convert
42
42
  args[1] = "html";
43
+
43
44
  await this.execute(file, args, /\.html$/, output);
44
- const htmlText = await readFile(output, "utf-8");
45
- const { window } = new JSDOM(htmlText);
46
- const text = window.document.documentElement.innerText ?? window.document.body.innerText ?? htmlText;
45
+
46
+ let text = "";
47
+ if (file.contentSize < 10*1024*1024) {
48
+
49
+ const htmlText = await readFile(output, "utf-8");
50
+ const { window } = new JSDOM(htmlText);
51
+ text = window.document.documentElement.innerText ?? window.document.body.innerText ?? htmlText;
52
+ }
47
53
  await writeFile(output, text);
48
54
  return output;
49
55
  }