Problem/Motivation
MailFormatHelper::htmlToText() does not handle the situation where there are newlines in the link text. For example, given the test sequence:
$html_text = "<a href=\"http://some.url\">Link \ntext</a>";
$plain_text = drupal_html_to_text($html_text);
We get:
Link text
when we should get:
Link text [1]
[1] http://some.url
Steps to reproduce
Proposed resolution
Fix the regex to strip \n
from anchor text.
Remaining tasks
- Patch
Test- Review
- Commit