Improved Composer handling with PGP messages

This commit is contained in:
the-djmaze 2022-02-04 13:40:59 +01:00
parent 96de0be977
commit 3fc5216841
5 changed files with 103 additions and 125 deletions

View file

@ -35,7 +35,7 @@ const
addLinks: true // allow_smart_html_links
*/
sanitizeToDOMFragment: (html, isPaste/*, squire*/) => {
tpl.innerHTML = html
tpl.innerHTML = (html||'')
.replace(/<\/?(BODY|HTML)[^>]*>/gi,'')
.replace(/<!--[^>]+-->/g,'')
.replace(/<span[^>]*>\s*<\/span>/gi,'')
@ -104,7 +104,7 @@ const
}
if (!skipInsert) {
signature = (isHtml ? '<br/><br/><signature>' : "\n\n") + signature + (isHtml ? '</signature>' : '');
signature = isHtml ? `<p><signature>${signature}</signature></p>` : `\n\n${signature}\n\n`;
text = insertBefore ? signature + text : text + signature;