mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 20:10:19 +01:00
use monospace fontstyle for plaintext edit; preserve whitespace (horizontal AND vertical) if mail is plaintext (not containing any html)
This commit is contained in:
parent
8b740d21ff
commit
d695929880
@ -1,3 +1,8 @@
|
||||
textarea
|
||||
{
|
||||
font-family: monospace, sans-serif;
|
||||
}
|
||||
|
||||
th.activetab
|
||||
{
|
||||
color:#000000;
|
||||
|
@ -1,3 +1,8 @@
|
||||
textarea
|
||||
{
|
||||
font-family: monospace, sans-serif;
|
||||
}
|
||||
|
||||
.fmToggle
|
||||
{
|
||||
background-color:#f6efe0;
|
||||
|
@ -1018,6 +1018,14 @@ class translation
|
||||
*/
|
||||
static function convertHTMLToText($_html,$displayCharset=false,$stripcrl=false,$stripalltags=true)
|
||||
{
|
||||
// assume input isHTML, but test the input anyway, because,
|
||||
// if it is not, we may not want to strip whitespace
|
||||
$isHTML = true;
|
||||
if (strlen(strip_tags($_html)) == strlen($_html))
|
||||
{
|
||||
$isHTML = false;
|
||||
// return $_html; // maybe we should not proceed at all
|
||||
}
|
||||
if ($displayCharset === false) $displayCharset = self::$system_charset;
|
||||
//error_log(__METHOD__.$_html);
|
||||
#print '<hr>';
|
||||
@ -1122,7 +1130,7 @@ class translation
|
||||
$_html = preg_replace('~<a[^>]+href=\"([^"]+)\"[^>]*>(.*)</a>~si','[$2 -> $1]',$_html);
|
||||
|
||||
// reducing double \r\n to single ones, dont mess with pre sections
|
||||
if ($stripcrl === true )
|
||||
if ($stripcrl === true && $isHTML)
|
||||
{
|
||||
if (stripos($_html,'<pre>')!==false)
|
||||
{
|
||||
@ -1160,18 +1168,14 @@ class translation
|
||||
$_html = preg_replace('~<[^>^@]+>~s','',$_html);
|
||||
//$_html = strip_tags($_html, '<a>');
|
||||
}
|
||||
// reducing spaces
|
||||
$_html = preg_replace('~ +~s',' ',$_html);
|
||||
// we dont reduce whitespace at the start or the end of the line, since its used for structuring the document
|
||||
#$_html = preg_replace('~^\s+~m','',$_html);
|
||||
#$_html = preg_replace('~\s+$~m','',$_html);
|
||||
// reducing spaces (not for input that was plain text from the beginning)
|
||||
if ($isHTML) $_html = preg_replace('~ +~s',' ',$_html);
|
||||
// restoring ampersands
|
||||
$_html = str_replace('#amper#sand#','&',$_html);
|
||||
//error_log(__METHOD__.__LINE__.' Charset:'.$displayCharset.' -> '.$_html);
|
||||
$_html = html_entity_decode($_html, ENT_COMPAT, $displayCharset);
|
||||
//error_log(__METHOD__.__LINE__.' Charset:'.$displayCharset.' After html_entity_decode: -> '.$_html);
|
||||
//self::replaceEmailAdresses($_html);
|
||||
#error_log($text);
|
||||
$pos = strpos($_html, 'blockquote');
|
||||
//error_log("convert HTML2Text: $_html");
|
||||
if($pos === false) {
|
||||
|
Loading…
Reference in New Issue
Block a user