Skip to content

isSingleGist is too broad and incorrect #80

@fregante

Description

@fregante
  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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions