Wordpress stripping out HTML when blogging by email

Discussion in 'WordPress' started by LongHaul, Feb 11, 2008.

  1. #1
    I have seen this problem addressed on other places, but not much, and never with a clear resolution.

    I have set up blogging by email successfully, but certain parts of HTML tags get stripped out. For example, this:

    <div style="padding: 5; background-color: #369">
    <p class="bodytext">I am <strong>listening</strong> to the Who.</p>
    </div>


    gets changed to this:

    <div>
    <p>I am <strong>listening</strong> to the Who.</p>
    </div>


    As you can see, all tags remain but their parameters are all missing. Why WP would go out of their way to do this I can't imagine, but it seems deliberate.

    I have tried stripping out all \n line breaks both before and after emailing. I have deleted the line in wp-mail.php that strips tags. Nothing works. (The message as mailed is fine; it's when WP gets the mail and makes a post out of it that the problem occurs. I can't even see how WP adds line breaks here and there, which it does, much less why. And I certainly don't understand why they would make HTML tag removal so buried.)

    Someone on a WP board mentioned that he'd gotten around it by adding a no_follow parameter to his wp_insert_post but I don't exactly know what he means or how to add that parameter (I assume it's done within wp-mail.php?) This is the only indication I've found of someone getting it to work, but he didn't explain it.

    Can anyone help with this? It's aggravating having my posts (which are generated thru a cron job, so I can't be online each time to do this manually, which is the whole point) with almost no custom formatting.
     
    LongHaul, Feb 11, 2008 IP