it seems that when adding a reply from WP Dashboard, wpDiscuz no longer (since v7) applies paragraphs for line breaks in content (no wpautop() being run?). Despite having multiple lines, comment body is displayed in HTML as one paragraph.
What's interesting is that comments added the same way (from Dashboard) with versions prior to v7 are displayed correctly as having multiple paragraphs (although there's no spacing but that's a minor CSS issue).
Also - I've tried editing the comment by manually adding < p > tags but the comment is still displayed as one constant text inside one paragraph. Is it by design or is it a bug?
Yes, I have the same complaint. The behavior in standard WordPress comments is that if you hit "Return" once at the end of a paragraph the line ends with a "<br>." But if you hit "Return" twice Wordpress creates a "<p>".
But even this behavior is clunky. Everywhere else -- including right here in this reply form -- a "Return" produces a new paragraph.
In wpDiscuz v. 7, the behavior is even less intuitive. Hitting "Return" twice at the end of a line just produces a second "<br>". The result of that is just ugly -- big gaps between paragraphs.
I will not upgrade to v.7 until this is addressed. The behavior I want is that a single "Return" produces a new paragraph.
@lflier yes, this is strange. I mean - why bother with rich editor if whole text is jammed in one paragraph. This is extremely unreadable, especially in long comments and discussions.
I have no idea how you get that problem. Maybe you use an old version of wpDiscuz, maybe your theme has a hard CSS affection on comment section. In any case, you should provide a direct link to that page where we can see the issue.
Currently, there is no such problem in wpDiscuz, please see the GIF video, and test on the demo:
yes, @szmigieldesign, the wpautop() is always being triggered.
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.
@asti do you have any ideas what I might want to check in order to debug this issue? I also tried editing the post via the frontend and while on edit view it's nicely separated, it's being displayed inside one < p > tag.
Which means that it's saved with line breaks in database but must be processed somewhere before it's displayed.
Here's what I'm seeing when I attempt to reproduce your video example:
The output is as @szmigieldesign has described. The entire comment is contained within a single <p> tag. In the HTML output, "paragraphs" are just lines separated by <br> tags.
Why is this a problem? Well, for starters, <br> tags cannot be formatted with CSS. It's impossible to add margins or padding between paragraphs when there are no paragraphs. Another problem is that if you want to increase the line spacing in the <p> tag you wind up with impossibly wide spacing where there are double <br> tags.
A workaround is suggested by the filter in class.WpdiscuzCore.php at line 548. Using the filter, it's possible to replace line breaks in the comment text like this:
I tried wpautop() in the above function but I can't get it working:
$comment_content = wpautop( $comment_content );
One problem with this code is that it produces empty paragraphs between line 2 and line 3, in the example above. I don't have time right now to work on that, but I thought I would post it as a start toward solving the problem.