-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improve Gist detection; exclude Gist profiles from isProfile
#132
Conversation
✅ Deploy Preview for preview-for-github-url-detection ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
]); | ||
|
||
export const isGist = (url: URL | HTMLAnchorElement | Location = location): boolean => url.hostname.startsWith('gist.') || url.pathname.split('/', 2)[1] === 'gist'; | ||
export const isGist = (url: URL | HTMLAnchorElement | Location = location): boolean => typeof getCleanGistPathname(url) === 'string'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was incorrect. It would match gist.any.com
while in reality GHE probably only supports /gist/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember we had a link to a github enterprise that we were able to test things out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong:
http(s)://[hostname]/gist
orhttp(s)://gist.[hostname]
if subdomains are enabled.
package.json
Outdated
@@ -34,6 +34,7 @@ | |||
"test": "run-p build ava xo", | |||
"watch": "run-p watch:typescript demo:watch # vite watch doesn’t generate the lib, so just use the demo", | |||
"watch:typescript": "tsc --watch --noEmit", | |||
"watch:ava": "run-p ava watch:typescript -- --watch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AVA times out when there are certain type errors 🤷♂️
isProfile
supposed to include gist profiles? #117isSingleGist
is too broad and incorrect #80