Skip to content
Snippets Groups Projects
Commit 97c22635 authored by Igor Markin's avatar Igor Markin
Browse files

Update regex

parent 774cf9c9
No related branches found
No related tags found
1 merge request!20Add seal word to plain normalisation regex
......@@ -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,
""
);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment