Skip to content

Commit

Permalink
chore: Copy the formatted code instead of the raw value
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 11, 2020
1 parent 3f1c35a commit 6fec89f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/CodeSnippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const CodeSnippet = ({ children, copy, className, lineNumbers }) => {
</div>
{copy !== 'false' && (
<div className={styles.copyBar}>
<button type="button" onClick={() => copyCode(children)}>
<button type="button" onClick={() => copyCode(formattedCode.trim())}>
<FeatherIcon name="copy" size="1rem" className={styles.copyIcon} />
{copied ? 'Copied!' : 'Copy output'}
</button>
Expand Down

0 comments on commit 6fec89f

Please sign in to comment.