Visual editor is stripping out html line break and paragraph tags

  • I am trying to do simple line spacing and paragraph spacing using the wordpress.com Visual Editor. I can’t figure out how to add more than one blank line.

    See this Support page: http://support.wordpress.com/code/
    It says that I can use the line break tag <br /> and paragraph tag <p> in my page/post content. However the Visual Editor strips out every instance of my (br) and (p) tags.

    Being able to add extra lines is critical on this page: http://gulfcoastblacksmith.wordpress.com/gallery/

    I want the second image on the page to start like a new paragraph, left justifies, below the first image, with an extra line between the first image (and its related text) and the second image (and its related text).

    I can’t make this work. The Visual Editor is stripping out very method I am using to add extra lines, such as simply hitting the Enter key to add several blank lines, or Shift-Enter, or the <br /> tag, or the <p> tag. Nothing works.

    I even changed my theme to see if the problem is related to the theme I am using, however the same thing happened with a different theme, so it seems to be a Visual Editor issue.

    I know I can turn the Visual Editor off and just use html, however many of my other authors would be lost. They absolutely have to use the Visual Editor.

    I need a solution, please. Thanks.

    The blog I need help with is: (visible only to logged in users)

  • It’s crude, but if you only need that functionality on a few posts, why don’t you just do it by clicking to the HTML tab and making the change? It should stay then. Your other authors won’t be able to add extra lines, but presumably they don’t need them very often.

  • Thank you for the suggestion, raincoaster. I really would take your advice, but this is driving my authors bonkers and every time they change a page they have to contact me to clean it up. I really need a solution.

    I have poured over all of the posts on this topic. The only solution I have found is to insert the following html code in the HTML Editor mode: <br class="blank" />

    That seems to be the only method of adding line spacing that is not stripped out by the Visual Editor. However even this will be difficult for most of my authors.

    The only solution that works in the Visual Editor is to add a new paragraph (Enter) or a new line (Shift+Enter) with text, then color the text the same color as the page background (in my case, white). That works, but it is such a kludge solution, it makes me ill. I hesitate to even recommend it to my authors, because most of them will forget that the invisible text exists on the page.

    I’m still hoping for a solution to this in the Visual Editor. Someone needs to get WordPress to look into this. Judging form the amount of forum chatter on this topic, it is definitely a major issue for many people who are dealing with authors who are not HTML fluent.

  • The reason extra lines are stripped out is that in the HTML/XHTML standards, paragraph spacing is defined as one blank line between. Any more than that and it is stripped out. That is also the reason you cannot have two spaces between sentences.

    Personally I would like to see the ability to have more than one blank line between paragraphs. There are times when this is desirable.

  • The reason extra lines are stripped out is that in the HTML/XHTML standards, paragraph spacing is defined as one blank line between. Any more than that and it is stripped out. That is also the reason you cannot have two spaces between sentences.

    Personally I would like to see the ability to have more than one blank line between paragraphs. There are times when this is desirable.

  • The reason extra lines are stripped out is that in the HTML/XHTML standards, paragraph spacing is defined as one blank line between. Any more than that and it is stripped out. That is also the reason you cannot have two spaces between sentences.

    Personally I would like to see the ability to have more than one blank line between paragraphs. There are times when this is desirable.

  • You are correct, and I understand about the HTML/XHTML standards. However WordPress needs to provide a simple solution for multiple line spacing for the Visual Editor. Here’s my suggestion of how they might do it. They should add a new button on the Visual Editor button panel that automatically inserts the following html code at the current cursor position: <br class="blank">

    While they’re at it, they should also add a Horizontal Rule button on the Visual Editor button panel that automatically inserts the following html code at the current cursor position: <hr />

    I just wish someone at WordPress would take this on as a personal project.

  • Contact staff and make the suggestions. I have in the past. Hopefully you will have more luck than I did.

  • Thanks, @panaghiotisadam. However I need solution that works in the Visual Editor for additional line spacing, for my authors who are not HTML-fluent.

  • Visual editor workaround: write a line comprising one or more spaces, highlight it, and click one of the “heading” options under the “Format/Paragraph” button.

  • The complete novice’s answer is to press return, type a “.” until you have enough space between paragraphs, then select the dots, and choose “white” from the font color button. They won’t show up unless someone were to copy the post and change the color to black in their copy. Also, you have to keep looking at “preview” to see if you have enough lines with the periods…

  • I forgot about that one. An oldie but a goodie.

  • Harks back to the early days of the automobile (horseless carriages??) when pharmacies sold gasoline…

  • And we had to type uphill both ways in the snow.

  • FYI, this suggestion was made by Sheri at WordPress Support:

    * Open a post for editing
    * Create a few blank lines
    * Highlight only the blank lines and click the left align icon (see icon #7
    at http://faq.wordpress.com/2006/05/15/what-do-all-the-icons-mean/ )
    * Save and view the post

  • dandelph,
    ok?
    I must be doing something differently, but that doesn’t seem to work.

  • The topic ‘Visual editor is stripping out html line break and paragraph tags’ is closed to new replies.