-
Notifications
You must be signed in to change notification settings - Fork 0
Add TypeScript Playground link support #84
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for react-github-permalink ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: dwjohnston <[email protected]>
Co-authored-by: dwjohnston <[email protected]>
Co-authored-by: dwjohnston <[email protected]>
… and null checks Co-authored-by: dwjohnston <[email protected]>
Co-authored-by: dwjohnston <[email protected]>
Enables rendering TypeScript Playground URLs as syntax-highlighted code blocks, matching existing GitHub permalink functionality. Addresses issue #104.
Implementation
Core Components:
parseTypeScriptPlaygroundUrl()- Extracts LZ-compressed code and line metadata from playground URLsdefaultGetTypeScriptPlaygroundFn()- Decompresses playground code usinglz-stringlibraryTypeScriptPlayground/TypeScriptPlaygroundBase/TypeScriptPlaygroundRsc- Client, base, and RSC component variants following existing permalink patternsSecurity:
typescriptlang.orgonly) to prevent domain spoofing[email protected]dependencyUsage
RSC variant:
Screenshots
Component rendering with TypeScript errors visible in comments:
Shows TypeScript logo, line numbers from specified start line, copy button, and link to original playground.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.comnext-server (v15.3.4)(dns block)storybook.js.orgnode /home/REDACTED/work/react-github-permalink/react-github-permalink/node_modules/.bin/storybook build(dns block)node /home/REDACTED/work/react-github-permalink/react-github-permalink/node_modules/.bin/storybook dev -p 6006(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.