Skip to content

Conversation

@westonruter
Copy link
Owner

As reported in a support topic:

Can’t paste XML or HTML into the Code block when this plugin is activated. It basically pastes in a blank line.

Note: If you change the block to “Edit as HTML” and try pasting into that, you end up with the “Invalid block” error. So your only option is to manually type in the code.

The reason for the bug is that our RichText support was added (in #200) before this issue was reported upstream in WordPress/gutenberg#26689 and fixed by introducing the __unstablePastePlainText prop in WordPress/gutenberg#27236

The fix appears to just be to add the __unstablePastePlainText prop as the Core code block now has.

Before:

before.mov

After:

after.mov

@westonruter westonruter merged commit a1e0514 into develop Dec 20, 2020
@westonruter westonruter deleted the fix/plain-text-paste branch December 20, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants