Skip to content

fix(editor): NO-JIRA empty div issue with nested block elements#1121

Open
Maysam Kangarani Farahani (maysamkf) wants to merge 2 commits intostagingfrom
fix-spacing-issue
Open

fix(editor): NO-JIRA empty div issue with nested block elements#1121
Maysam Kangarani Farahani (maysamkf) wants to merge 2 commits intostagingfrom
fix-spacing-issue

Conversation

@maysamkf
Copy link
Contributor

@maysamkf Maysam Kangarani Farahani (maysamkf) commented Mar 12, 2026

Empty div issue with nested block elements

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

These types will increment the version number on release:

  • Fix
  • Feature
  • Performance Improvement
  • Refactor

📖 NO-JIRA

📖 Description

  • Added logic to not convert divs with block children into paragraphs

💡 Context

Nesting a block element in a div would cause it to render an extra newline (see SS below).
This is likely due to how Tiptap tries to flatten the html when parsing it.

📝 Checklist

For all PRs:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

📷 Screenshots / GIFs

Observed Issue:

Screenshot 2026-03-11 at 6 17 09 PM

Fix:

Screenshot 2026-03-11 at 6 17 05 PM

@github-actions
Copy link
Contributor

✔️ Deploy previews ready!
😎 Dialtone documentation preview: https://dialtone.dialpad.com/deploy-previews/pr-1121/
😎 Dialtone-vue preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-1121/

Copy link
Contributor

@braddialpad Brad Paugh (braddialpad) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a bit of a hack, is this not something that can be configured in TipTap/prosemirror itself?

If there's truly no other option we can go with it.

@maysamkf
Copy link
Contributor Author

This feels like a bit of a hack, is this not something that can be configured in TipTap/prosemirror itself?

If there's truly no other option we can go with it.

tried looking for other ways, but this seems to be the only way AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-visual-test Add this tag when the PR does not need visual testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants