@emailens/engine 0.9.1 → 0.9.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/README.md +27 -8
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8772,8 +8772,9 @@ var PREHEADER_ACCESSORY_PATTERNS = [
|
|
|
8772
8772
|
/color\s*:\s*transparent/,
|
|
8773
8773
|
/line-height\s*:\s*0/
|
|
8774
8774
|
];
|
|
8775
|
+
var INVISIBLE_CHARS = /[-]/g;
|
|
8775
8776
|
function isLikelyPreheader(style, text) {
|
|
8776
|
-
if (text.length > 200) return false;
|
|
8777
|
+
if (text.replace(INVISIBLE_CHARS, "").trim().length > 200) return false;
|
|
8777
8778
|
return PREHEADER_ACCESSORY_PATTERNS.some((p) => p.test(style));
|
|
8778
8779
|
}
|
|
8779
8780
|
function checkHiddenText($) {
|
|
@@ -10089,7 +10090,11 @@ function toPlainText(html) {
|
|
|
10089
10090
|
return;
|
|
10090
10091
|
}
|
|
10091
10092
|
const isBlock = BLOCK_TAGS.has(tag);
|
|
10092
|
-
if (isBlock)
|
|
10093
|
+
if (isBlock) {
|
|
10094
|
+
flushLine();
|
|
10095
|
+
} else if (currentLine && !currentLine.endsWith(" ")) {
|
|
10096
|
+
currentLine += " ";
|
|
10097
|
+
}
|
|
10093
10098
|
if (tag === "li") {
|
|
10094
10099
|
currentLine = "- ";
|
|
10095
10100
|
}
|