That fixed the line break issue, but it broke emoji’s in comments, they don’t display with the code running.
I want to share more of the issue here.
This is an example of what your plugin is doing.
I type, “This is a test comment.” Hit enter and type “This is a test comment.” I then opened my browsers inspector tool and this is how the code appears.
<div class="ql-editor" data-gramm="false" contenteditable="true" data-placeholder="Join the discussion">
<p>This is a test comment.</p>
<p>This is a test comment.</p>
</div>
That’s correct and what should display. However, once I click Post Comment, this is the code that actually renders.
<div class="wpd-comment-text">
<p>This is a test comment
<br>
This is a test comment.</p>
</div>
That is not correct and makes the comments look less professional.
When I do the same thing with your plugin off, using default WP comments, this is the code that renders when the comment is posted.
<div class="comment-content">
<p>default 2</p>
<p>default 2</p>
</div>
That is correct.
I cannot explain why your code looks correct before posting a comment, but then changes after. However, I can see what’s going on from a user perspective.
When posting a comment with WP-Discuz a user types a line, hits enter and it appears as if there is an empty space in between. Like this.
Test comment.
Test comment.
However, when you use default WP comments a user types a line hits enter once, and the comment looks like this.
Test comment.
Test comment.
So the user knows to hit enter a SECOND time, so the comment then displays properly like this.
Test comment.
Test comment.
As a fix, I noticed theme CSS for the “p” tag are affecting this. So I took the code your plugin uses and set a margin of 0em.
#comments p, #respond p {
margin-bottom: 0em;
}
Now, as you type a comment and hit return once, your comment properly looks like this.
Test comment.
Test comment.
Now the user will know to hit return once more, twice total, so there comment properly looks like this as they type.
Test comment.
Test comment.
Once they post the comment, it will then properly display with a p tag for each new line. Perhaps this is a modification to add into core. Most people are never going to figure this out. This is my third attempt to understand the problem and I finally figured it out.
Unfortunately, I don’t know how to fix past comments to replace the <br> tag.