Skip to content
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

isSingleGist is too broad and incorrect #80

Closed
fregante opened this issue Jun 4, 2021 · 1 comment · Fixed by #132
Closed

isSingleGist is too broad and incorrect #80

fregante opened this issue Jun 4, 2021 · 1 comment · Fixed by #132
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@fregante
Copy link
Member

fregante commented Jun 4, 2021

  1. These two (old) URLs are not detected as isSingleGist:
https://gist.github.com/fregante/2205329b71218fa2c1d3
https://gist.github.com/fregante/2205329b71218fa2c1d3/d1ebf7d9cfaba4d4596d2ea9174e202479a5f9ad # this is a specific gist revision
  1. This is also detected as isGist, but is actually a /raw/ file, not a gist at all:
https://gist.github.com/fregante/2205329b71218fa2c1d3/raw/d1ebf7d9cfaba4d4596d2ea9174e202479a5f9ad/iframe.js
  1. This is correctly detected as isGist, but maybe we should have a more specific isSingleGistCode so that only the code tab is detected.
https://gist.github.com/fregante/2205329b71218fa2c1d3/revisions

These changes should probably be based on https://github.com/sindresorhus/refined-github/blob/1a9c4f9b/source/features/embed-gist-inline.tsx#L9-L23 and will replace that inline function (which intends to be isSingleGistCode, but is more like a more specific isSingleGist)

Go to demo: https://fregante.github.io/github-url-detection/

@fregante fregante added bug Something isn't working help wanted Extra attention is needed labels Jun 4, 2021
@fregante
Copy link
Member Author

3. This is also detected as isGist, but is actually a /raw/ file, not a gist at all:

This is actually fine. isGist means it's on the Gist website. I don’t think we have isRaw detections since extensions don't need to work there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

Successfully merging a pull request may close this issue.

1 participant