Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable easier copy to clipboard of block list text #53

Open
bobbingwide opened this issue Sep 16, 2022 · 1 comment
Open

Enable easier copy to clipboard of block list text #53

bobbingwide opened this issue Sep 16, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Sep 16, 2022

The oik-block/blocklist block provides a plain text view that I've been using to create a snapshot of the blocks delivered in each version of Gutenberg. By comparing the files for two versions I can see which blocks have been added, changed or deleted.

attributes are:

<!-- wp:oik-block/blocklist {"prefix":"core","showBlockLink":false,"showBatch":true,"component":"gutenberg"} -->

The trouble is, when the block is displayed in this mode it's really really difficult to select all the text to be copied to the clipboard and to only get the text and not the <br /> tags.

I've not found an easy solution with the current implementation of the block.
What can I do to make it easier?

  • Should I provide my own copy to clipboard button?
  • Change the <pre> to a <TextareaControl> ?

BTW. There's also a problem that occurs when toggling the value of showBlockLink. Sometimes the contents doesn't get fully replaced.

@bobbingwide bobbingwide added the enhancement New feature or request label Sep 16, 2022
@bobbingwide bobbingwide self-assigned this Sep 16, 2022
@bobbingwide
Copy link
Owner Author

bobbingwide commented Sep 16, 2022

The trouble is, when the block is displayed in this mode it's really really difficult to select all the text to be copied to the clipboard and to only get the text and not the <br /> tags.

The workaround is to select the text in two parts, the top half and the bottom half.
It's fairly easy to stop in the middle of the text. Almost impossible to stop at the end.

Another workaround is to save the post and view the output.
It should be a lot easier to select the contents of the <pre> tag from the front end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant