Twitter URL Embed automatically in Preformatted Blocks
Describe the bug When two or more Twitter links are included, they will be embedded automatically.
To reproduce Steps to reproduce the behavior:
- Go to 'new post'
- Click on 'Preformatted'
- post 2 twitter URL
- See error there URL Embed
Expected behavior Preformatted Blocks have automatically embed when there are two or more Twitter links. This is not expressed when there is one link. The last link URL in the block is displayed in text. This phenomenon occurs not only with Twitter URLs but also with embed URLs.
Screenshots

Desktop (please complete the following information):
- OS: Mac OS 10.12.6
- Browser chrome
- Version 74.0.3729.157
Additional context
- WordPress 5.21 / Twenty Nineteen
I'm unable to reproduce:

The first two twitter links are in a pre-format block. The last embed resulted from pasting one of those links in a paragraph block (which transformed to an embed).
Are there any plugins interacting with the WordPress editor active on your site?
Thank you for testing! The plug-in was completely stopped. I will try to find a little more about the bug.
All plug-ins are turned off.
When I put two separate Twitter links in the same way as you did, the bug did not appear. But when I made it three, it appeared.
I don't know yet what kind of standard this bug occurs.

It seems that a similar problem occurs when we unlink the URLs in a preformatted block and open preview. 2nd and later URL turns into embed card if unlinked and the first one doesn't.

Ya I'm reproducing this now too when I go to three urls in the pre-formatted block. I'm not seeing the pasted urls as linkable (like @kamataryo) though.
I think we can sufficiently say this bug is reproducible though.
This command reproduce an unintended embedding and creates a post with an embed card inside <pre />:
$ wp post create --post_author=1 --post_title=test --post_content='
<!-- wp:preformatted -->
<pre class="wp-block-preformatted">
https://wordpress.org/news/2019/05/wordpress-5-2-1-maintenance-release/
</pre>
<!-- /wp:preformatted -->'
Without linebreaks, embed cards would not appear.
$ wp post create --post_author=1 --post_title=test --post_content='
<!-- wp:preformatted -->
<pre class="wp-block-preformatted">https://wordpress.org/news/2019/05/wordpress-5-2-1-maintenance-release/</pre>
<!-- /wp:preformatted -->'
I included three Twitter URLs and the first link in the block is displayed in text.


Reproduction Report
Description
This report validates whether the issue can be reproduced.
Environment
- WordPress: 6.9-alpha-60273
- PHP: 8.2.28
- Server: Apache/2.4.62 (Debian)
- Database: mysqli (Server: 11.4.7-MariaDB-ubu2404 / Client: mysqlnd 8.2.28)
- Browser: Chrome 137.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.2
- MU Plugins:
- Gutenberg Test Plugin, Disable Login Autofocus
- Gutenberg Test Plugin, Disable Remote Patterns
- Gutenberg Test Plugin, Enable Templates UI
- Gutenberg Test Plugin, No-cache Headers
- Gutenberg Test Plugin, Normalize Theme
- server-timing.php
- Plugins:
- Gutenberg 21.0.0-rc.1
- Test Reports 1.2.0
Actual Results
- ✅ Error condition occurs (reproduced).
Additional Notes
- To reproduce:
- Open
Code Editorin the block editor screen. - Add the following content.
<!-- wp:preformatted -->
<pre class="wp-block-preformatted">
https://wordpress.org/news/2019/05/wordpress-5-2-1-maintenance-release/
</pre>
<!-- /wp:preformatted -->
- Save and Preview.
Supplemental Artifacts
https://github.com/user-attachments/assets/2f3c8b68-9101-4d5f-9028-0b1cffcd644d
I would like to work on this issue.