From: Michael M Slusarz Date: Fri, 19 Feb 2010 19:57:50 +0000 (-0700) Subject: More html2text tweaks X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4aec82a01e66c0eeebb4e71fa8506904e0fdad4c;p=horde.git More html2text tweaks --- diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index a548dd97a..698aa1bc3 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -96,7 +96,7 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base // '/|\s[^>]*>)(.+?)<\/strong>/ie' => 'strtoupper("\\1")', - '/(.+?)<\/span>/ie' => 'strtoupper("\\1")', + '/(.+?)<\/span>/ie' => 'strtoupper("\\1")', // '/|\s[^>]*>)(.+?)<\/i>/i' => '/\\1/', @@ -130,7 +130,10 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base // Some mailers (e.g. Hotmail) use the following div tag as a way // to define a block of text. - '/
(.+?)<\/div> ?/i' => '\\1
', + '/
(.+?)<\/div> ?/i' => '\\1
', + + // Cite blocks. + '/\s*]*(?:type="?cite"?|class="?gmail_quote"?)[^>]*>\s*/i' => '', //
'/]*>/i' => "\n" @@ -158,13 +161,10 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base public function postProcess($text) { /* Convert blockquote tags. */ - $text = preg_replace(array('/
]*(type="?cite"?|class="?gmail_quote"?)[^>]*>\n?/', - '/\n?<\/blockquote>\n?/is'), - array(chr(0), chr(1)), - $text); - if (strpos($text, chr(0)) !== false) { - $text = $this->_blockQuote($text); - } + return $text; + // if (strpos($text, chr(0)) !== false) { + // $text = $this->_blockQuote($text); +// } /* Strip any other HTML tags. */ $text = strip_tags($text);