Fix: Pass Copied Content as prop
Add prop to fence component called content which will hold the content contained within the fence component. Update code snippet component so that it filters the fence components passed to it as children to only display the fence component that is same language as the selected language and pass the content prop of the fence component to the copy code button component on each render of the snippet component.
This commit is contained in:
@@ -21,6 +21,7 @@ export default function Fence({
|
||||
<code
|
||||
className={`language-${language}`}
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
content={content}
|
||||
></code>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user