fix: join copied commands without a space

This commit is contained in:
Aarnav Tale 2025-04-02 13:25:33 -04:00
parent 5e5c7c4c7a
commit 17d477bf0f
No known key found for this signature in database

View File

@ -24,9 +24,7 @@ export default function Code({ isCopyable, children, className }: CodeProps) {
type="button" type="button"
className="bottom-0 right-0 absolute" className="bottom-0 right-0 absolute"
onClick={async (event) => { onClick={async (event) => {
const text = Array.isArray(children) const text = Array.isArray(children) ? children.join('') : children;
? children.join(' ')
: children;
const svgs = event.currentTarget.querySelectorAll('svg'); const svgs = event.currentTarget.querySelectorAll('svg');
for (const svg of svgs) { for (const svg of svgs) {