function _simplenews_html_replace in Simplenews 6.2
Same name and namespace in other branches
- 6 simplenews.module \_simplenews_html_replace()
- 7.2 includes/simplenews.mail.inc \_simplenews_html_replace()
- 7 includes/simplenews.mail.inc \_simplenews_html_replace()
Helper function for simplenews_html_to_text().
List of preg* regular expression patterns to search for and replace with
1 call to _simplenews_html_replace()
- simplenews_html_to_text in includes/
simplenews.mail.inc - HTML to text conversion for HTML and special characters.
File
- includes/
simplenews.mail.inc, line 775 - Simplenews email send and spool handling
Code
function _simplenews_html_replace() {
return array(
'/"/i' => '"',
'/>/i' => '>',
'/</i' => '<',
'/&/i' => '&',
'/©/i' => '(c)',
'/™/i' => '(tm)',
'/“/' => '"',
'/”/' => '"',
'/–/' => '-',
'/’/' => "'",
'/&/' => '&',
'/©/' => '(c)',
'/™/' => '(tm)',
'/—/' => '--',
'/“/' => '"',
'/”/' => '"',
'/•/' => '*',
'/®/i' => '(R)',
'/•/i' => '*',
'/€/i' => 'Euro ',
'/⁄/i' => '/',
// put a space before cell content, avoid collapse
'#(</(?:th|td)[^>]*>)#i' => ' $1',
// make sure <tr> represents a line
'#(</tr[^>]*>)#i' => '<br />$1',
);
}