mpratt / Embera

A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has advanced features like offline support, responsive embeds and caching support.
MIT License
339 stars 59 forks source link

Github Gists #44

Closed deenison closed 8 years ago

deenison commented 8 years ago

First of all, thanks for this lib. Its awesome! :)

But I think I found a minor limitation when it comes to Github Gists urls. The problem is that the current version of Embera doesn't support all gists url variations, I'm afraid of.

If we check both the test file TestServiceGithubGist.php and the service provider code GithubGist.php, its clear that the support covers the following url pattern:

github\.com\/(?:[^\/]+)\/([\d]+)\/?

which basically translates to:

github.com/<GIST-OWNER-USERNAME>/<GIST-ID>

The issue comes when we have a gist whose its GIST-ID consist in an alpha-numeric value, not only numeric values, defined by the [\d]+ rule.

I.e, where both cases should be considered as valid ("good"):

So, wouldn't be better if we change that numeric rule to [a-z0-9]+ (already using case-insensitive flag)?

Regards.

mpratt commented 8 years ago

Hi @deenison ! Thanks for the report and for the PR.

I merged it and will be tagging a new release as soon as I make some other updates to the library

deenison commented 8 years ago

Awesome!! Thanks @mpratt