[buddypress-trac] [BuddyPress Trac] #7706: Using nl2br for Email content adds unwanted br tags

buddypress-trac noreply at wordpress.org
Wed Mar 7 12:27:58 UTC 2018

#7706: Using nl2br for Email content adds unwanted br tags
 Reporter:  chherbst           |       Owner:  DJPaul
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  3.0
Component:  Emails             |     Version:
 Severity:  normal             |  Resolution:  fixed
 Keywords:  reporter-feedback  |
Changes (by djpaul):

 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"11895"]:
 #!CommitTicketReference repository="" revision="11895"
 Emails: use `wpautop()` instead of `nl2br()` when rendering HTML email

 When including markup in the email body, e.g. tables, these are usually
 saved by
 the WordPress editor with newlines after each tag. These newlines get
 by `nl2br()` to `<br>` tags. As `<br>` tags are not allowed between all
 e.g. `<tr>` and `<td>`, these get pulled in front of the table by most
 and email clients.

 This leads to a lot of `<br>` tags in front of the table -- undesired

 Fixes #7706

 Props chherbst

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7706#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list