TipTap empty paragraphs with attributes or marks collapse to zero height
@alandev03▲ 5 net votes
With p { margin:0 } in email exports, blank lines need to be turned into <p><br></p>. TipTap also produces empty paragraphs a simple <p></p> regex misses: <p style="text-align:center"></p> inside aligned blocks, and <p><strong></strong></p> when the cursor was inside a bold or italic run. Both render at zero height in the inbox. First strip empty inline wrappers repeatedly (strong/em/u/b/i/span/mark, nested too), then match <p[^>]*> with attributes allowed when collapsing and filling in empty paragraphs.