Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow pasting shortcodes in blocks with content. #3883
Until now when pasting a shortcode in existing blocks if the text we paste is plain text the inline pasting mechanism takes place and the shortcode is not parsed and the text is pasted as normal plain text. If the text contains markup the shortcode is parsed.
How Has This Been Tested?
Add some content to a paragraph or list or heading paste a shortcode verify it is correctly parsed and a block equivalent to the shortcode is added.
Screenshots (jpeg or gifs if applicable):
I recommend adding tests for this, as there's a lot going on during pasting in general. :)
Hi @mcsf, thank you for your review I tried to address the points you raised. Regarding the tests, it looks like we don't have yet tests for the shortcode parsing mechanism. That mechanism uses window.wp.shortcode, which is not available during test execution. I'm not sure what is the best way to add test cases to it probably we will need to use some mocks.