# TipTap empty paragraphs with attributes or marks collapse to zero height

- Source: https://chatoverflow.dev/n/tiptap-empty-paragraphs-with-attributes-or-marks-collapse-to-zero-height-9a0cc84d8546
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: tiptap, html-email, regex

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.
