Code and Preformatted blocks no longer correctly accept pasted text/code
Description
Source file ending like this:
# backports:
#
# Software from a newer release of the distribution, or even from the
# development branch of the distribution, but built against this release.
# It may provide newer features, but should be considered untested.
#
# Note: Software in this repository WILL NOT receive any review or
# updates from the Ubuntu security team.
#
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports main restricted
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports main restricted
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports universe
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports universe
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports multiverse
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports multiverse
pastes like this:
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2021/06/broken-preformatted-block.png
Does not matter what text editor is used on either Windows 10 or Ubuntu Linux.
Code for shell script content has also developed the truly annoying problem of putting first line against left margin then indenting all other lines by one space, sometimes more.
Step-by-step reproduction instructions
- Pull down this file on either Windows 10 or Ubuntu 20.04 LTS.
- Open in any basic text editor.
- Select-all. Copy.
- Create new WordPress post.
- Set block to either Code or Preformatted
- Paste.
Expected behaviour
It should look just like it does in the text editor.
Actual behaviour
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2021/06/broken-preformatted-block.png
Screenshots or screen recording (optional)
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2021/06/broken-preformatted-block.png
Code snippet (optional)
WordPress information
- WordPress version: 5.7.2
- Gutenberg version: whatever is standard in 5.7.2
- Are all plugins except Gutenberg deactivated? yes
- Are you using a default theme (e.g. Twenty Twenty-One)? No. I tried many different themes
Device information
- Device: Desktop
- Operating system: Windows 10, Ubuntu 20.04 LTS, Ubuntu 16.04 LTS
- Browser: Windows 10: Opera 76.0.4017.177; Firefox 89.0; Ubuntu 16.04 LTS: FireFox 88.0; Ubuntu 20.04 LTS: FireFox 89.0; Opera 77.0.4054.64 u18-sources-list.txt
Hi,
Thanks for reporting. Are you able to reproduce this after you have installed and activated the newest version of Gutenberg that is available through the Gutenberg plugin?
I am unable to reproduce the behavior that you describe when using the newest version of Gutenberg, 10.9.1 as indicated in the screen recording
https://user-images.githubusercontent.com/955351/124017137-5f3b6200-d9b4-11eb-9888-c69222b28348.mp4
Hello,
I'm using the block editor in WordPress and WordPress directs all bug reports to Gutenberg for the editor. I have not manually installed a plug-in.
I opened the attached C source file in Notepadqq. Started a new post.
Here is what pasting into a code block looks like.
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2021/06/guten-bug-2.png
Current version: 5.7.2
After installing and activating the plugin you say fixes it.
https://www.logikalsolutions.com/wordpress/wp-content/uploads/2021/06/guten-bug-3.png
My gut tells me someone is trying to support "markup" in the code block and you just cannot do that. # < and other symbols all have special meaning in markup. You have to nuke support for markup.
Roland
On 6/30/21 2:04 PM, Will Skora wrote:
Hi,
Thanks for reporting. Are you able to reproduce this after you have installed and activated the newest version of Gutenberg that is available through the Gutenberg plugin https://wordpress.org/plugins/gutenberg/?
I am unable to reproduce the behavior that you describe when using the newest version of Gutenberg, 10.9.1 as indicated in the screen recording
https://user-images.githubusercontent.com/955351/124017137-5f3b6200-d9b4-11eb-9888-c69222b28348.mp4 https://user-images.githubusercontent.com/955351/124017137-5f3b6200-d9b4-11eb-9888-c69222b28348.mp4
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WordPress/gutenberg/issues/32649#issuecomment-871655102, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOLYVAUFPYWIU7N3NQJUUTTVNTDTANCNFSM46TXW7EA.
-- Roland Hughes, President Logikal Solutions (630)-205-1593
http://www.theminimumyouneedtoknow.com http://www.infiniteexposure.net http://www.johnsmith-book.com http://www.logikalblog.com http://www.interestingauthors.com/blog
Now you guys are even deleting the leading quotations.

https://user-images.githubusercontent.com/1883220/124507662-d9dcf680-dd93-11eb-9a27-32bb3f556f60.mp4
Tested this issue in the following conditions:
Environment: Windows Theme: Twenty Twenty-One WordPress 5.8 Core Only (No Gutenberg Plugin) WordPress 5.8 Core + Gutenberg Plugin Enabled
Theme: TT1 Blocks WordPress 5.8 Core + Gutenberg Plugin Enabled.
Copy/pasting:
# backports:
#
# Software from a newer release of the distribution, or even from the
# development branch of the distribution, but built against this release.
# It may provide newer features, but should be considered untested.
#
# Note: Software in this repository WILL NOT receive any review or
# updates from the Ubuntu security team.
#
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports main restricted
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports main restricted
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports universe
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports universe
#deb http://old-releases.ubuntu.com/ubuntu hardy-backports multiverse
#deb-src http://old-releases.ubuntu.com/ubuntu hardy-backports multiverse
Displayed as intended with the block on both the front end and within the block editor.
Result: Could not duplicate the reported issue. Either it may have been fixed with 5.8, or it may be a theme related bug with the display on markdown?
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
All data was provided, with video. I, like most people, use Ubuntu for my primary desktop, not Windows.
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
Unable to reproduce.