mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Resolve #283
This commit is contained in:
parent
42813b90dd
commit
58f5e90f8f
|
@ -95,9 +95,7 @@ export const
|
|||
];
|
||||
|
||||
tpl.innerHTML = html
|
||||
.replace(/(<pre[^>]*>)([\s\S]*?)(<\/pre>)/gi, aMatches => {
|
||||
return (aMatches[1] + aMatches[2].trim() + aMatches[3].trim()).replace(/\r?\n/g, '<br>');
|
||||
})
|
||||
// .replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, pre => pre.replace(/\n/g, '\n<br>'))
|
||||
.replace(/<!doctype[^>]*>/gi, '')
|
||||
.replace(/<\?xml[^>]*\?>/gi, '')
|
||||
// Not supported by <template> element
|
||||
|
|
|
@ -64,16 +64,14 @@
|
|||
}
|
||||
|
||||
pre, code {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: var(--fontMono);
|
||||
display: block;
|
||||
font-family: var(--fontMono);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
word-break: normal;
|
||||
word-wrap: break-word;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
code {
|
||||
|
@ -82,9 +80,8 @@
|
|||
}
|
||||
|
||||
pre {
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
background-color: #f9f9f9;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
pre > code {
|
||||
|
|
|
@ -222,7 +222,7 @@ abstract class HtmlUtils
|
|||
}
|
||||
|
||||
return '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'
|
||||
. \MailSo\Base\Utils::StripSpaces($oDoc->saveHTML($oBody)) . '</html>';
|
||||
. $oDoc->saveHTML($oBody) . '</html>';
|
||||
}
|
||||
|
||||
public static function ConvertPlainToHtml(string $sText, bool $bLinksWithTargetBlank = true) : string
|
||||
|
|
Loading…
Reference in a new issue