-
Notifications
You must be signed in to change notification settings - Fork 94
Labels
bugSomething isn't workingSomething isn't workinghacktoberfestA Tag for HacktoberfestA Tag for Hacktoberfest
Description
Fix Console Error in Copy-Code Utility
Description
The copy-code utility in src/utils/copy-code.ts logs a console.error when no code content is found to copy. This creates unnecessary console noise and doesn't provide user-friendly feedback when the copy operation fails.
How To Reproduce
- Go to any page with code blocks (e.g., a blog post with markdown code)
- Open browser developer tools (F12)
- Click on a copy button that has no
data-codeattribute or empty content - Check the console tab
- See error: "No code content found to copy"
Expected behavior
- No console errors should appear during normal usage
- Users should receive visual feedback when copy operation fails
- Error handling should be user-friendly rather than developer-focused
Environment
Desktop
- Operating System: Windows/macOS/Linux (all affected)
- Browser: Chrome, Safari, Firefox (all affected)
- Version: Current main branch
Smartphone
- Device: All devices
- OS: All mobile OS
- Browser: All mobile browsers
- Version: Current main branch
Console Errors
console.error('No code content found to copy');Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghacktoberfestA Tag for HacktoberfestA Tag for Hacktoberfest