-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Convert to blocks loses marked up content inside a blockquote #4992
Comments
As I said in #5028 (comment) This is not a backwards compatibility issue because converting to block is an explicit action you can undo and it can't be 100% accurate because the blocks don't support all kind of markup. So transforming the markup mentioned above is impossible because the quote can't contain headings at the moment, it's just a list of paragraphs. Maybe it shouldn't be converted in that case though. cc @iseulde |
It’s unexpected loss of data. Had I converted a very large block I might have missed the fact that the block quote had gone missing. There are a number of potential improvements that can be envisaged. For example. Check your resultsIt should be easy enough to strip the HTML comments from the generated blocks, compare the generated HTML with the original HTML and report the differences. Classic Text blockAnother is to support a Classic Text block where the content is left completely untouched by the editor. No wpautop processing, no new lines converted to br’s. Nothing. This will help with other issues where existing blocks do not satisfy the requirements. See #4456 and #4672. In my opinion this is something that is needed to help early adopters demonstrate to others that the site doesn’t break. A nice way of saying ‘You were doing it wrong but now we’ve fixed it for you’. I’ll raise a separate requirement if you like.. none of the existing blocks support what I need. |
That's what we already do if you don't click "convert". Am I misunderstanding something? |
IMO, there will always be a difference. An example of this is the autogenerated className per block. I think a solution could be to add a confirmation to this button explaining that loss of data is possible and improve the algorithm to minimise it (like I suggested above, don't convert if the blockquote contains tags other than paragraphs) |
The Classic block looks and works a bit like the Tiny MCE editor, but there is no Text editor equivalent.
I've modified the original HTML in the Text Editor and it looks fine in the Visual Editor.
Copying and pasting this into a new post fails to recognise the cite. It's pretty impressive but just needs to be even slicker. |
Isn't the HTML mode per block the equivalent for the text editor for the classic block? I'm just trying to understand here. What exactly are you proposing here? |
So the raw handler will preserve the heading tags, but the quote block transformation only grabs paragraph tags from the wrapper. We could adjust the quote block transform to either take all HTML (it's just one big MCE instance anyway) or to convert these tags to paragraphs. Atm the block doesn't really support anything other than paragraphs, so the latter makes more sense for now. This could all change though if the quote block would consist of nested blocks (which I think it should so you can add lists etc.) |
This would be addressed by making Quote have a nested area where you can add different blocks. |
Yeah |
Keeping headings, lists, etc. will be possible if #6054 is merged. |
Now that #6054 has landed, we should make sure this use-case is accommodated for. |
@danielbachhuber #6054 was reverted in #6501. There is a new PR for nested blocks in quotes: #6520. |
Just wanted to note that after some changes related to the Raw Handler component this test case no longer loses content but it is transformed into an HTML block. |
Let's close this in favour of #15486. The problem here is that a quote should allow other blocks inside it. |
Issue Overview
Having created a post using the Classic editor I attempted to convert it from the Classic block to blocks.
It correctly determined that it should create a blockquote but lost all the content.
This is a backward compatibility issue.
Steps to Reproduce (for bugs)
This can be achieved in the Visual editor by pasting the text of the quote, selecting it all and then clicking on the blockquote and h3 toolbar buttons in that order.
2. Save
3. Open in the new editor
3. Choose convert to blocks
Expected Behavior
Current Behavior
The text disappears.
Possible Solution
Screenshots / Video
Related Issues and/or PRs
Todos
The text was updated successfully, but these errors were encountered: