protected function Html2Text::converter in Swift Mailer 7
2 calls to Html2Text::converter()
- Html2Text::convert in includes/classes/Html2Text.inc
- Html2Text::convertBlockquotes in includes/classes/Html2Text.inc
- Helper function for BLOCKQUOTE body conversion.
File
- includes/classes/Html2Text.inc, line 347
Class
- Html2Text
Code
protected function converter(&$text) {
$this
->convertBlockquotes($text);
$this
->convertPre($text);
$text = preg_replace($this->search, $this->replace, $text);
$text = preg_replace_callback($this->callbackSearch, array(
$this,
'pregCallback',
), $text);
$text = strip_tags($text);
$text = preg_replace($this->entSearch, $this->entReplace, $text);
$text = html_entity_decode($text, ENT_QUOTES, self::ENCODING);
$text = preg_replace('/&([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/', '', $text);
$text = str_replace('|+|amp|+|', '&', $text);
$text = preg_replace("/\n\\s+\n/", "\n\n", $text);
$text = preg_replace("/[\n]{3,}/", "\n\n", $text);
$text = ltrim($text, "\n");
if ($this->options['width'] > 0) {
$text = wordwrap($text, $this->options['width']);
}
}