diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-05-20 21:40:59 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-05-20 21:40:59 +0000 |
| commit | 9a5457cc37e3afc638fc194eccba6333365cec2e (patch) | |
| tree | 9781252b35e09a1ca9834dd0dde609fdc80ee257 /roundcubemail/program/include/rcube_shared.inc | |
| parent | 83b297e2b198bd9034fb82d942353be51d003dea (diff) | |
Don't wrap quoted lines at all
git-svn-id: https://svn.roundcube.net/trunk@3645 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_shared.inc')
| -rw-r--r-- | roundcubemail/program/include/rcube_shared.inc | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/roundcubemail/program/include/rcube_shared.inc b/roundcubemail/program/include/rcube_shared.inc index a130391f7..2c3e63933 100644 --- a/roundcubemail/program/include/rcube_shared.inc +++ b/roundcubemail/program/include/rcube_shared.inc @@ -259,7 +259,12 @@ function rc_wordwrap($string, $width=75, $break="\n", $cut=false) $para = explode($break, $string); $string = ''; while (count($para)) { - $list = explode(' ', array_shift($para)); + $line = array_shift($para); + if ($line[0] == '>') { + $string .= $line.$break; + continue; + } + $list = explode(' ', $line); $len = 0; while (count($list)) { $line = array_shift($list); @@ -270,25 +275,25 @@ function rc_wordwrap($string, $width=75, $break="\n", $cut=false) $string .= ($len ? ' ' : '').$line; $len += (1 + $l); } else { - if ($l > $width) { - if ($cut) { - $start = 0; - while ($l) { - $str = mb_substr($line, $start, $width); - $strlen = mb_strlen($str); - $string .= ($len ? $break : '').$str; - $start += $strlen; - $l -= $strlen; - $len = $strlen; - } - } else { - $string .= ($len ? $break : '').$line; - if (count($list)) $string .= $break; - $len = 0; - } - } else { + if ($l > $width) { + if ($cut) { + $start = 0; + while ($l) { + $str = mb_substr($line, $start, $width); + $strlen = mb_strlen($str); + $string .= ($len ? $break : '').$str; + $start += $strlen; + $l -= $strlen; + $len = $strlen; + } + } else { + $string .= ($len ? $break : '').$line; + if (count($list)) $string .= $break; + $len = 0; + } + } else { $string .= $break.$line; - $len = $l; + $len = $l; } } } |
