arn-rawmime 0.1.2 → 0.1.3
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 +1 -1
- package/src/rawmimeBuilder.d.ts +1 -0
- package/src/rawmimeBuilder.js +8 -5
package/package.json
CHANGED
package/src/rawmimeBuilder.d.ts
CHANGED
package/src/rawmimeBuilder.js
CHANGED
|
@@ -475,8 +475,12 @@ class MimeMessage {
|
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
// Default encoding is now 'quoted-printable'
|
|
478
|
-
addText({ data, encoding = "quoted-printable", charset = "UTF-8" }) {
|
|
479
|
-
|
|
478
|
+
addText({ data, encoding = "quoted-printable", charset = "UTF-8", autoMinify = false }) {
|
|
479
|
+
let finalData = data;
|
|
480
|
+
if (autoMinify && typeof finalData === "string") {
|
|
481
|
+
finalData = finalData.replace(/\s+/g, " ").trim();
|
|
482
|
+
}
|
|
483
|
+
this._addBodyPart(finalData, "text/plain", encoding, charset);
|
|
480
484
|
}
|
|
481
485
|
|
|
482
486
|
/**
|
|
@@ -491,7 +495,7 @@ class MimeMessage {
|
|
|
491
495
|
data,
|
|
492
496
|
encoding = "quoted-printable",
|
|
493
497
|
autoTextPart = false,
|
|
494
|
-
autoMinify =
|
|
498
|
+
autoMinify = true,
|
|
495
499
|
markdownToHtml = false,
|
|
496
500
|
charset = "UTF-8",
|
|
497
501
|
}) {
|
|
@@ -532,8 +536,7 @@ class MimeMessage {
|
|
|
532
536
|
|
|
533
537
|
let finalHtml = data;
|
|
534
538
|
|
|
535
|
-
|
|
536
|
-
if (shouldMinify) {
|
|
539
|
+
if (autoMinify) {
|
|
537
540
|
finalHtml = this._minifyHtml(finalHtml);
|
|
538
541
|
}
|
|
539
542
|
|