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(code): copying interpolated variables #75

Merged
merged 2 commits into from
Nov 18, 2020
Merged

Conversation

kellyjosephprice
Copy link
Collaborator

🧰 Changes

The Code component uses the syntax-highlighter for variable
interpolation, but it was passing the uninterpolated text to the copy
function.

The Code component uses the syntax-highlighter for variable
interpolation, but it was passing the uninterpolated text to the copy
function.
@kellyjosephprice kellyjosephprice requested review from a team, dok and kunal-pathak and removed request for a team November 17, 2020 20:47
Copy link

@kunal-pathak kunal-pathak left a comment

Choose a reason for hiding this comment

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

@kellyjosephprice this looks pretty solid to me and like a positive change, but I don't have a ton of context in this area yet, so I'm gonna add @rafegoldberg in addition to myself!

Copy link
Contributor

@rafegoldberg rafegoldberg left a comment

Choose a reason for hiding this comment

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

👍 LGTM. Did you test this linked to ReadMe as well, or just against your unit tests?

const copyClass = `${rootClass}_copied`;
const button = React.createRef();
/* istanbul ignore next */
const copier = () => {
const code = codeRef.current.textContent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Slick.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me double check. I tested before writing the tests and stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, after much linkage, it works for me locally.

__mocks__/copy-to-clipboard.js Show resolved Hide resolved
@kellyjosephprice kellyjosephprice merged commit 872adca into next Nov 18, 2020
@kellyjosephprice kellyjosephprice deleted the bug/code-variables branch November 18, 2020 23:34
rafegoldberg pushed a commit that referenced this pull request Nov 23, 2020
## Version 6.22.3

### 🛠 Fixes & Updates

* add codemirror as exp dep ([#82](#82)) ([5a3aa52](5a3aa52))
* **code:** copying interpolated variables ([#75](#75)) ([872adca](872adca))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v6.22.3

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

Successfully merging this pull request may close these issues.

3 participants