Problem/Motivation
I'm using Simplenews + cck + Nodereference + Mimemail for sending newsletters in plain text (Mimemail because a custom module uses it to attach files to other mails).
Everything works fine except the transformation "html mail" -> "plain mail".
Given:
<h2>Band name</h2>
Result:
-------- Band name
-----------------------------------------------------------
As you can see there is a linebreak in the headline. I figured out that the core helper function _drupal_html_to_text_pad() adds one '-' too much. After changing line
$n = max(0, 79 - (strlen($text) - $p) - strlen($prefix));
to
$n = max(0, 78 - (strlen($text) - $p) - strlen($prefix));
everything works fine.
Are there other people out there with this problem? If not - do you have any ideas what's going wrong?
A little debug information:
$n = max(0, 79 - (strlen($text) - $p) - strlen($prefix));
dpm(strlen($text)); // 783
dpm($p); // 766
dpm(strlen($prefix)); // 1
dpm($n); // 61
PHP Version: 5.2.6-1+lenny9
Steps to reproduce
TBA
Proposed resolution
TBA
Remaining tasks
TBA
User interface changes
API changes
Data model changes
Release notes snippet