Newer
Older
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizePlainPart = void 0;
// this is a Node module. require is a must to work across different envs
const URL = require("url-parse");
const utils_1 = require("../utils");
const normalizePlainPart = (text) => {
return removeQRCodes(text);
};
exports.normalizePlainPart = normalizePlainPart;
const patchOutlookSafelinksWrappers = (text) => {
const links = text.match(/<https:.+?(safelinks\.protection\.outlook\.com).+?>/g);
if (links) {
links.forEach((link) => {
const url = new URL(link.slice(1, link.length - 1), true);
const originalUrl = url.query["url"];
text = text.replace(link, `<${originalUrl}>`);
});
}
return text;
};
.replace(/\[(image:)*qrcode.png]\s*<https:\/\/[\w./?=\-&]+>/g, "")
.replace(/<https:\/\/[\w./?=\-&]+>\s*\[(image: )*qrcode.png]/g, "");
const removeListBullets = (s) => {
return s.replace("\n[o§]\n+/g", "");
};