-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transform pasted div tags to p tags #38042
Conversation
… from editors that use divs (such as Evernote)
Size Change: +13 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
This seems like a nice addition but I"m concerned about generating invalid markup. Am I right in saying it wouldn't be great to end up with nested <p>
tags?
packages/blocks/src/api/raw-handling/test/phrasing-content-reducer.js
Outdated
Show resolved
Hide resolved
@getdave I revisited the approach used in this PR. What do you think now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the way it removes the wrapping div and then normalizes everything else.
I dont have a tonne of knowledge about potential knock ons here but no tests broke and this one now handles the nesting use case so I'm hopeful this will be ok.
Nice work!
Description
Solves #34160
With this PR applied, content pasted from Evernote is no longer collapsed into the same paragraph:
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
cc @ellatrix @getdave @jorgefilipecosta @draganescu @noisysocks