• When sending an email via outlook in HTML, it sends tags in a pretty sloppy manner. One problem is that wordpress interprets a newline character as intentional, and adds a <br>, therefore breaking the tag if the tag is on 2 lines. Where is the code where it adds the <br>? Cant seem to find it. Seems like it would be easy to just add something in to handle this. Thanks in advance.

    Example:
    blah random whatever <span
    style=blah>text</span>

    Turns into:
    blah random whatever <span <br>
    style=blah>text</span>

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    That is all added in post-processing, for the actual display of the post. The wpautop function handles most of it.

    Thread Starter djdaverich

    (@djdaverich)

    What page is that in?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Why not search through it? Use an editor like TextPad and hit ctrl-f5 to text search through multiple files.

    Thread Starter djdaverich

    (@djdaverich)

    Cause I’d have to open all of the files, didnt know if someone just knew off the top of their heads.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Why would you have to open all the files? Like I said, Textpad can search through multiple files. Without opening them.

    For that matter, Windows built in search is perfectly capable of finding text in a file in a directory, it’s just really annoying to use.

    Get a good editing program that can search multiple files. You don’t need to open them all one by one.

    I’m planning on using the phone_content filter to strip the newlines from the email text.

    You need to call add_filter for the hook phone_content. In your function that filters the message, you need to do the following:

    $new_content = str_replace(array(“\r\n”, “\r”), “\n”, $content);
    $new_content = ereg_replace(“([^\n])\n([^\n])”, ‘\1 \2’, $new_content);

    The first line handles the different forms of end-of-line markers. The second line converts all single newlines to spaces.

    Give it a try.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Where is the “\n” to “<br>” code for blog by email?’ is closed to new replies.