diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 3c046e71..ef604ba0 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -107,6 +107,11 @@ export async function replaceBody(tabId, replyHtml) { await messenger.compose.setComposeDetails(tabId, {body: fullBody}); } +export function sanitizeHtml(input) { + // Keep only
tags and remove all other HTML tags + return input.replace(/<(?!br\s*\/?)[^>]+>/gi, ''); +} + export function i18nConditionalGet(str) { // if we are getting a string that starts with '__MSG_' and ends with '__' we return the translated string // using the browser.i18n API