diff --git a/src/PlainNormalizer/PlainNormalizer.ts b/src/PlainNormalizer/PlainNormalizer.ts index a30c84dfc3d887d338e6cc57fe46e7b92ee1d069..82310741784a5bb05d855f3da34f19cbacf2eeff 100644 --- a/src/PlainNormalizer/PlainNormalizer.ts +++ b/src/PlainNormalizer/PlainNormalizer.ts @@ -28,14 +28,20 @@ const patchOutlookSafelinksWrappers = (text: string) => { return text; }; +/** + * Function removes seal from the plain text. + * Function has to support the next possible file names of the seal: + * qrcode.png, qrcode-xxx.png, seal-xxx.png + * @param s + */ const removeQRCodes = (s: string): string => { return s .replace( - /\[(image:\s)*qrcode.png]\s*<https:\/\/.+(vereign\.com|vrgnservices\.com).*?>/g, + /\[(image:\s)*(qrcode|seal).*?.png]\s*<https:\/\/.+(vereign\.com|vrgnservices\.com).*?>/g, "" ) .replace( - /<https:\/\/.+(vereign\.com|vrgnservices\.com).*?>\s*\[(image: )*qrcode.png]/g, + /<https:\/\/.+(vereign\.com|vrgnservices\.com).*?>\s*\[(image: )*(qrcode|seal).*?.png]/g, "" ); };