Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297608

MailFormatHelper::htmlToText() incorrect handling of newlines in anchor links

$
0
0

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

  1. Patch
  2. Test
  3. Review
  4. Commit

Viewing all articles
Browse latest Browse all 297608

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>