Jump to content

Sanitizer to strip tags but keep line breaks


Robin S
 Share

Recommended Posts

When using basic WireMail I'm looking for a way to convert the HTML message to a plain text version while keeping line breaks.

For example, I want:

<h1>She sells seashells</h1>
<p>On the sea shore.</p>

...to become...

She sells seashells
On the sea shore.

I thought one of the sanitizer methods might help out here and I've tried a few things with the "newlineReplacement" option for $sanitizer->textarea but no luck yet.

Any suggestions?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...