-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
The Code component uses the syntax-highlighter for variable interpolation, but it was passing the uninterpolated text to the copy function.
There was a problem hiding this 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!
There was a problem hiding this 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slick.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This PR was released!🚀 Changes included in v6.22.3 |
🧰 Changes
The Code component uses the syntax-highlighter for variable
interpolation, but it was passing the uninterpolated text to the copy
function.