X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FString.php;h=eaae593b46e6551f6696784e259f9266479946e9;hb=b5a104e41f5250de860b532494fd869cbc5a61d5;hp=257c0374d706cfddf9a7aa763c8ca20c0353a7c7;hpb=52df19870805bf5a2bae2388a1f6c5a0309c2d92;p=civicrm-core.git diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 257c0374d7..eaae593b46 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -402,7 +402,7 @@ class CRM_Utils_String { /** * Convert a HTML string into a text one using html2text * - * @param string $html the tring to be converted + * @param string $html the string to be converted * * @return string the converted string * @access public @@ -410,8 +410,11 @@ class CRM_Utils_String { */ static function htmlToText($html) { require_once 'packages/html2text/rcube_html2text.php'; - $converter = new rcube_html2text($html); - return $converter->get_text(); + $token_html = preg_replace('!\{([a-z_.]+)\}!i', 'token:{$1}', $html); + $converter = new rcube_html2text($token_html); + $token_text = $converter->get_text(); + $text = preg_replace('!token\:\{([a-z_.]+)\}!i', '{$1}', $token_text); + return $text; } static function extractName($string, &$params) {