Forums

Line Breaks Ignored in Wordpress Comments (12 posts)

  1. wordblogger
    Member
    Posted 11 months ago #

    New lines are being ignored when the comments are displayed on my blog. The first new line is displayed, but any subsequent new lines are ignored. For example if you wanted to add 1 blank line between paragraphs (as you normally would), you would publish your comment looking like this:

    //begin example
    Hello

    Goodbye
    //end example

    However wordpress is displaying it like this:

    //begin example
    Hello
    Goodbye
    //end example

    When you view the comments through the admin panel, everything looks fine. I am having no problems with blog posts. I am only having problems with comments. Also, I can force a new line using the br html tag in the comments, but the users will not know this; nor should they have to. Why does wordpress remove new lines that have purposely been entered using the "enter" key?

    I have looked at similar posts regarding this problem with no help.

    Point me in the right direction please.

    wordblogger

  2. esmi
    Moderator
    Posted 11 months ago #

    Why does wordpress remove new lines that have purposely been entered using the "enter" key?

    WordPress doesn't but your current theme might.

  3. wordblogger
    Member
    Posted 10 months ago #

    Thanks for your reply.

    Unfortunately I can't figure out where in my style.css things are getting screwed up. Would you have a suggestion as to how I can get "new lines" displayed in my comments? Below is the portion of my style.css that refers to the comments section:

    #commentblock h2 {
    font-size : 17px;
    color : #307396;
    padding : 20px 0 10px 0;
    margin : 0;
    font-weight : normal;
    }
    #commentblock {
    padding : 5px;
    margin : 40px 0 15px 0;
    }
    #commentblock p {
    font-size:11px;
    }
    ol#commentlist {
    padding : 0;
    margin : 10px 0 0 0;
    list-style-type : none;
    }
    .commentdate {
    font-size : 10px;
    padding-left : 0;
    }
    #commentlist li p {
    margin: 2px;
    padding : 0;
    }
    .commentname {
    color : #666;
    margin : 0;
    padding : 5px 5px 5px 0;
    }
    .commentinfo {
    clear : both;
    }
    .commenttext {
    clear : both;
    margin : 0 0 10px 0;
    padding : 2px;
    border:2px solid #f5f5f5;
    background:white;
    }
    .commenttext-admin {
    clear : both;
    margin : 0 0 10px 0;
    padding : 2px;
    border:2px solid #e8f7ff;
    background:#f5fcff;
    }
    .commenttext-admin p {
    margin-top: 1000px;
    }
    #commentsformheader {
    padding-left : 0;
    }
    #commentsform {
    text-align : center;
    margin : 0;
    padding : 0;
    }
    #commentsform form {
    text-align : left;
    margin : 0;
    }
    #commentsform p {
    margin: 0;
    }
    #commentsform form textarea {
    width : 99%;
    background : #fff;
    border : 1px solid #ddd;
    font-family: Tahoma, Verdana, sans-serif;
    }
    p.comments_link img {
    margin : 0;
    padding : 0;
    border-top-style : none;
    border-right-style : none;
    border-bottom-style : none;
    border-left-style : none;
    }

    Thanks to those who lend a hand.

  4. wordblogger
    Member
    Posted 10 months ago #

    Still no help or resolution on this issue.

    Anyone out there :-)

  5. esmi
    Moderator
    Posted 10 months ago #

    A link to your site would help.

  6. chollaball
    Member
    Posted 8 months ago #

    look for something like this:

    #commentlist li p{ margin: 0 0 0 0;}

    change to this line or similar.

    #commentlist li p{ margin: 0px 0px 10px 0px;}

  7. Ogatha
    Member
    Posted 4 months ago #

    I've got the exact same problem. I found the rule that chollaball was talking about but it didn't help much, unfortunately. It looked like this for me:

    ol.commentlist li p { font-size:12px; margin:0 0 1em; }

    I changed it into this:

    ol.commentlist li p { font-size:12px; margin: 0px 0px 10px 0px;}

    And tried different values for the margin, but nothing happens. This is starting to become quite a problem for me as I'm gaining more and more comments on the blog. Any help with the issue would be greatly appreciated.

  8. Ogatha
    Member
    Posted 4 months ago #

    Anyone?

  9. Ogatha
    Member
    Posted 4 months ago #

    I can't believe no one else has this problem.

  10. Ogatha
    Member
    Posted 3 months ago #

    I solved this on my own. It wasn't the commentlist rule that I needed to change, it was the rule formatting the paragraphs in the comment section itself. It looked like this for me:

    div.bubble blockquote p { line-height:16px; margin:0px; padding:0px; }

    I changed it into:

    div.bubble blockquote p { line-height:16px; margin-top:10px; padding:0px; }

    The line-height attribute is set to 16px because that's the line-height I use in my normal posts and I wanted it to look symmetric. In addition to those 16px, though, every new paragraph now gets an additional 10px in distance to the one preceding it. It's an easy way around the autoformatting problem.

  11. KnowingArt_com
    Member
    Posted 2 months ago #

    Autoformatting?

  12. KnowingArt_com
    Member
    Posted 2 months ago #

    Turns out, this is possibly a bug in Google Chrome. Same comment renders fine in Firefox but does not skip lines in Chrome.

Reply

You must log in to post.

About this Topic