-
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
code block does not preserve HTML code when pasting #27386
Comments
New HTML (output)
This feels like it could be a browser bug with contenteditable, but if it is then it's one I think has existed for a while. Should this just be a textarea? Idk, it's working as expected on a few sites I've checked, but not in storybook for latest master. Old HTML (output)
|
I just removed the repo and re-pulled. Looks like this is fixed in master anyway. Check it out. |
I don't have time to test right away. I only know this is the behavior I get both on windows and linux (two completely different PC's and different browsers) with a fresh installation of WP 5.6-RC1. It happens for all blocks by the way. When I paste code from a text editor (VS code, notepad, gedit), Gutenberg automatically renders the HTML. This is actually pretty nice for paragraph blocks and so on, but doesn't make much sense for the code block. Will try to test by pulling master later. |
Closing as this was fixed in #27236. Testing with latest master, I can no longer reproduce the issue. It is also fixed in 5.6 RC2 which is now available for testing. |
@tellthemachines Please see my comment here: |
Describe the bug
When pasting HTML code in the code block, the actual HTML gets rendered..
To reproduce
Steps to reproduce the behavior:
Expected behavior
Preserve the code
Screenshots
Happens on all tested editor versions:
Happens on all tested OS and browsers:
The text was updated successfully, but these errors were encountered: