Skip to content
Snippets Groups Projects

Gmail to Outlook - complex text + embeded image + attachments

Merged Alexey Lunin requested to merge 122-gmail-to-outlook into master
@@ -18,6 +18,8 @@ export const normalizePlainPart = (
if (sealRemovalOptions) {
text = removeSeal(text, sealRemovalOptions.sealUrl);
}
text = cleanupImageText(text);
text = normalizeTextSpacings(text);
return text.trim();
@@ -56,6 +58,13 @@ const removeSeal = (plain: string, sealUrl: string): string => {
.replace(new RegExp(sealRegexReversed), "");
};
const cleanupImageText = (plain: string): string => {
// For cases [image: IMAGE_NAME.EXTENSION]
const sealRegex = `\\[(image:\\s)(.*)\\]`;
return plain.replace(new RegExp(sealRegex), "[$2]");
};
export const cleanupHiddenCharacters = (s: string): string => {
const removeSymbols = new RegExp(/[\u200B]+/g);
return s.replace(removeSymbols, "");
Loading