Gutenberg: Twitter URL Embed automatically in Preformatted Blocks

Created on 25 May 2019  Â·  6Comments  Â·  Source: WordPress/gutenberg

Describe the bug
When two or more Twitter links are included, they will be embedded automatically.

To reproduce
Steps to reproduce the behavior:

  1. Go to 'new post'
  2. Click on 'Preformatted'
  3. post 2 twitter URL
  4. 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

rzg2o-o6tte

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
[Block] Embed [Type] Bug

Most helpful comment

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 -->'

All 6 comments

I'm unable to reproduce:

Example

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.

gutenberg-preformatted-mis-embedding

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 -->'
Was this page helpful?
0 / 5 - 0 ratings