WordPress.org

Ready to get started?Download WordPress

Forums

WYSIWYG ignoring or reinterpreting HTML (13 posts)

  1. cutout
    Member
    Posted 7 years ago #

    My site has a series of static Pages, and in some of these pages the content region must contain a chunk of HTML which I've tried to stuff in the WYSIWYG window. Each time it's saved, though, the editor re-writes the markup. Example, I paste in this:

    </div>
    <div id="pagepic" class="right"><img src="/images/wrapper_work.jpg" alt="work" /></div>

    and I get this:

    <p id="pagepic" class="right"><img src="/images/wrapper_work.jpg" alt="work" /></p>

    Is there a plugin which will force the WYSIWYG to interpret HTML more literally?

  2. cutout
    Member
    Posted 7 years ago #

    WordPress is replacing my div tags with p tags, stripping break tags, and otherwise reinterpreting code in a way that is making the WYSIWYG tool a complete detriment to the software. Is no one else having this experience when creating static pages?

  3. Jonathan Landrum
    Member
    Posted 7 years ago #

    I turned off the WYSIWIG editor for that reason alone. The HTML editor isn't perfect (still won't let you post pure HTML; try inserting a comment) but it's a huge step forward.

  4. vkaryl
    Member
    Posted 7 years ago #

    As far as I've been able to determine, the only way to post "pure" html tags without wp insisting it knows better is to work within the database using phpmyadmin. And that is NOT an option for the faint of heart - one misplaced semi-colon among other possible things will bork the whole shebang - and your only option at that point is to drop all the tables and import a backup dump - assuming you have one.

    So if you're going to do this (and I admit, I do it myself on a regular - that is, daily - basis), make sure you have a dump before you start.

    You have been warned.... "DANGER Will Robinson".....

  5. Jonathan Landrum
    Member
    Posted 7 years ago #

    No thanks. I'm not afraid of phpMyAdmin; it just seems like it's not a lot of sugar for a dime.

  6. vkaryl
    Member
    Posted 7 years ago #

    *snicker* Yeah, you're probably right. Then again, there's anal.... and there's ANAL....

  7. Jonathan Landrum
    Member
    Posted 7 years ago #

    LOL! Good thing I wasn't drinking any water just now.

  8. vkaryl
    Member
    Posted 7 years ago #

    Um. Worse with red wine....

  9. cutout
    Member
    Posted 7 years ago #

    make sure you have a dump before you start.

    it just seems like it's not a lot of sugar for a dime.

    there's anal.... and there's ANAL....

    This thread just gets dirtier and dirtier.

    For anyone interested, there's also this suggestion which I'm about to try.


    the only way to post "pure" html tags without wp insisting it knows better is to work within the database using phpmyadmin.

    That is depressing, considering how much faith I otherwise have in WP. Why even offer a 'code' window at all if it takes what you write and reinterprets it?

  10. Jonathan Landrum
    Member
    Posted 7 years ago #

    Yeah, you could hack the snot out of the core, but it's going to be a pain to upgrade. Now, if you could roll your hack into a plugin, then you'd be in business.

  11. Andrew Ozz
    WordPress Dev
    Posted 7 years ago #

    You mean this 2 row plugin by John Godley @ http://www.urbangiraffe.com/plugins/disable-wpautop?
    remove_filter ('the_content', 'wpautop');
    remove_filter ('comment_text', 'wpautop');

  12. Jonathan Landrum
    Member
    Posted 7 years ago #

    Actually, that would probably work for part of it. I still don't think you'll get total HTML control, but it's another big step in the right direction.

    Edit: If you enable it on a working blog, though, be prepared to "fix" all your old posts! I should have been a good webmaster and put the <p> tags in there to begin with, but autop made me lazy. :o\

  13. cutout
    Member
    Posted 7 years ago #

    The wpautop plugin seems to be working in conjunction with this fix. But -- when I manually insert paragraph tags, WP/tinyMCE strips them. Aarrgh.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags