To ensure that users do not input multiple empty paragraphs in the text editor, I have found a method to eliminate a single <p><br></p>
from the text within the editor message.
var str = content.replace('<p><br></p>', '');
Nevertheless, my goal is to strip out all instances of the pattern <p><br></p>
, such as
<p><br></p><p><br></p>Lorem Ipsum is simply dummy text<p><br></p><p><br></p><p><br></p>
. Is there a more efficient way, perhaps using regex or another method, to achieve this with a single operation?