Describe the bug
My provider has just upgraded WP to 5.4. Since the upgrade, the Preformatted block loses all leading whitespace and the - characters on paste.
To reproduce
Copy the following text to clipboard
lotsa_spaces:
conundrum:
- foo:
answer: 42
- bar:
question:
Paste the text into any text editor to be sure that the text in clipboard is in fact formatted correctly, to exclude possible corruption when copying from the GitHub page.
In the post editor, add the Preformatted block, and paste text into it.
All whitespace and even the leading - symbols are deleted on paste.
Expected behavior
Pasted text keeps whitespace as is and does not lose significant characters on paste.
Screenshots
Desktop (please complete the following information):
OS: Windows 10 x64
Browser: Firefox 64-bit
Version: 75.0
Additional context
This is a regression; the Gutenberg version that came with the previous latest WP 5.3 did preserve formatting and did not lose characters.
All non-initial whitespace runs in the pasted text are compressed into one space. Also, the leading # characters are removed.
I cannot tell the Gutenberg version. I hope that "The version bundled with WP 5.4" is unambiguous? There is no Gutenberg plugin installed, so I am sure I am using the stock WP 5.4 version. I'll be happy to try anything you would suggest to narrow it better.
Symptoms look like a reoccurrence of the bug #6917, fixed nearly 2 years ago.
Workaround (horrifically inefficient)
Switch to HTML. Thanks for never adding a keyboard shortcut for this menu item, despite so many user pleas.
Add a line break between <pre> and </pre>
Paste text into the gap.
Remove extraneous line breaks before and after text.
Switch back to visual editing by dropping your keyboard, hunting for your mouse and mousing frantically through the dropdown menu. The block is now formatted as expected:
Describe the bug My provider has just upgraded WP to 5.4. Since the upgrade, the Preformatted block loses all leading whitespace and the
-
characters on paste.To reproduce
All whitespace and even the leading
-
symbols are deleted on paste.Expected behavior Pasted text keeps whitespace as is and does not lose significant characters on paste.
Screenshots
Desktop (please complete the following information):
Additional context This is a regression; the Gutenberg version that came with the previous latest WP 5.3 did preserve formatting and did not lose characters.
All non-initial whitespace runs in the pasted text are compressed into one space. Also, the leading
#
characters are removed.I cannot tell the Gutenberg version. I hope that "The version bundled with WP 5.4" is unambiguous? There is no Gutenberg plugin installed, so I am sure I am using the stock WP 5.4 version. I'll be happy to try anything you would suggest to narrow it better.
Symptoms look like a reoccurrence of the bug #6917, fixed nearly 2 years ago.
Workaround (horrifically inefficient)
Switch to HTML. Thanks for never adding a keyboard shortcut for this menu item, despite so many user pleas.
Add a line break between
<pre>
and</pre>
Paste text into the gap.
Remove extraneous line breaks before and after text.
Switch back to visual editing by dropping your keyboard, hunting for your mouse and mousing frantically through the dropdown menu. The block is now formatted as expected: