Skip to content
Snippets Groups Projects
Commit 37770c30 authored by Alexey Lunin's avatar Alexey Lunin
Browse files

build project

parent f792e741
No related branches found
No related tags found
1 merge request!27Gmail to Outlook - complex text + embeded image + attachments
Pipeline #44817 passed
......@@ -10,6 +10,7 @@ const normalizePlainPart = (text, sealRemovalOptions) => {
if (sealRemovalOptions) {
text = removeSeal(text, sealRemovalOptions.sealUrl);
}
text = cleanupImageText(text);
text = utils_1.normalizeTextSpacings(text);
return text.trim();
};
......@@ -39,6 +40,11 @@ const removeSeal = (plain, sealUrl) => {
.replace(new RegExp(sealRegex), "")
.replace(new RegExp(sealRegexReversed), "");
};
const cleanupImageText = (plain) => {
// For cases [image: IMAGE_NAME.EXTENSION]
const sealRegex = `\\[(image:\\s)(.*)\\]`;
return plain.replace(new RegExp(sealRegex), "[$2]");
};
const cleanupHiddenCharacters = (s) => {
const removeSymbols = new RegExp(/[\u200B]+/g);
return s.replace(removeSymbols, "");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment