• This is being entered as a new topic though it is an outgrowth of what has been discussed within this thread.

    I had authored a post to my blog using OpenOffice Writer and used copy/paste to put the text into the WordPress editor. As discussed in the referenced thread this caused HTML from the OpenOffice document to be entered into WordPress. That HTML does not coincide very well with the WordPress notion of a theme.

    Therefore, I undertook repairing the defective HTML using an HTML editor (Aptana Studio and Netbeans). After creating HTML suitable for use in WordPress I opened the WordPress editor in HTML mode and again used copy/paste to transfer the code from my computer to WordPress. It looks like WordPress does not like the new line characters that every browser ever produced sees as whitespace. I deduced this because when the resulting page is displayed by WordPress an HTML break tag has been inserted everywhere there was such a newline sequence even these break tags do not appear in the editable source code. I frankly cannot think of a reason why WordPress should behave this way. WordPress is essentially providing a capability to enter HTML and then decides it should alter perfectly valid HTML for no apparent reason and end up producing unwanted results.

    Possibly someone can tell us why this is being done but I have to argue that it is a particularly egregious violation of the HTML design that causes considerable problem for an author trying to produce their own HTML.

    The only solution I could find was to go back to my HTML editor and remove all of the line end sequences such that every paragraph was contained on a single line of code. This is not a very user friendly way to code markup.

    Possibly (or rather hopefully) there is a way to turn off this behavior and have WordPress stop altering the HTML introduced by the author of posts. WordPress might consider that such authors may know what they are doing and if they don’t they should still be allowed to screw up their own stuff rather than have WordPress screw it up for them.

Viewing 1 replies (of 1 total)
  • I discovered the same problem. Breaks were being inserted into a list of links. The breaks defeated the styling of the links (float left with interspersed breaks is a vertical column, in my case).

    I went into the database table wp_posts and manually removed the line breaks. The very next display reinserted them.

    I found that wpautop($content,$br) with $br=0 is supposed to halt the insertion of breaks, but I cannot find a way to set the site globally to do this. I am hesitant to make hard-wired changes to the core of wordpress.

    Pointers to where I can set the global for wpautop would be appreciated.

Viewing 1 replies (of 1 total)
  • The topic ‘Extraneous HTML Break tags’ is closed to new replies.