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

fix(v2): fix codeblock copy button not including blank lines #2285

Merged
merged 1 commit into from
Feb 16, 2020
Merged

fix(v2): fix codeblock copy button not including blank lines #2285

merged 1 commit into from
Feb 16, 2020

Conversation

kohheepeace
Copy link
Contributor

@kohheepeace kohheepeace commented Feb 15, 2020

Motivation

Fixes #2284 (copy button in CodeBlock ignores blank line in code block)

Have you read the Contributing Guidelines on pull requests?

Yes!

Test Plan

Related PRs

This is a PR to add "Copy" button #1643

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 15, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Feb 15, 2020

Deploy preview for docusaurus-2 ready!

Built with commit b22135a

https://deploy-preview-2285--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Seems like this bug existed since really long ago when the Copy button was added. I tested the fix on https://deploy-preview-2285--docusaurus-2.netlify.com/docs/creating-pages and couldn't get it to work. Could you test and see as well?

You might need to modify packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/index.js instead/as well.

@yangshun yangshun added the pr: bug fix This PR fixes a bug in a past release. label Feb 16, 2020
Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the changes for you. Thanks for the fix!

@yangshun yangshun changed the title fix(v2): fix codeblock copy button not including blank lines in clipb… fix(v2): fix codeblock copy button not including blank lines Feb 16, 2020
@yangshun yangshun merged commit 7086c27 into facebook:master Feb 16, 2020
@kohheepeace
Copy link
Contributor Author

Thanks for your help and approval! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[V2] Copy button in CodeBlock ignores blank line
4 participants