function _views_send_html_to_text in Views Send 6
HTML to text conversion for HTML and special characters. Converts some special HTMLcharacters in addition to drupal_html_to_text(). Inspired from Simplenews,
Parameters
$text: String: Source text with HTML and special characters.
Return value
String: Target text with HTML and special characters replaced.
1 call to _views_send_html_to_text()
- _views_send_prepare_mail in ./
views_send.module - Perform all alteration and preparation before spooling.
File
- ./
views_send.module, line 804 - The Views Send module.
Code
function _views_send_html_to_text($text) {
$pattern = '@<a[^>]+?href="([^"]*)"[^>]*?>(.+?)</a>@is';
$text = preg_replace_callback($pattern, '_views_send_absolute_mail_urls', $text);
// Replace some special characters before performing the drupal standard conversion.
$preg = _views_send_html_replace();
$text = preg_replace(array_keys($preg), array_values($preg), $text);
// Perform standard drupal html to text conversion.
return drupal_html_to_text($text);
}