Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Fix parse the content for openGraph image for github#145

Merged
leonardocardoso merged 1 commit into
leonardocardoso:mainfrom
MuhtasimTanmoy:bug/github-repo-invalid-image-fix
Jul 27, 2021
Merged

Fix parse the content for openGraph image for github#145
leonardocardoso merged 1 commit into
leonardocardoso:mainfrom
MuhtasimTanmoy:bug/github-repo-invalid-image-fix

Conversation

@MuhtasimTanmoy

Copy link
Copy Markdown
Contributor

Fixed

  • Description: Invalid response image attribute in case of any GitHub URL

  • Issue: Github Repository Image not parsed properly #144

  • Commit: 4701a0e

  • Changelog

    • Basically, the meta tag containing the target image in GitHub site looks like this. It has no extension as stated below.

    • So, this image pattern used for this particular case cant detect it.

      • static let imagePattern = "(.+?)\\.(gif|jpg|jpeg|png|bmp)$"
    • Also, first checking for "og:image" tag gets the right image as tested.

Sample Meta tag for target image in Github

<meta property="og:image" content="https://opengraph.githubassets.com/404e27b179d006746f87a82d651eba1e24a2dd7babd8
7cb16db0a4d09879e08c/bitcoin/bitcoin" />

@lhunath

lhunath commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

It likely doesn't make sense to try to match this URL against a pattern to try and detect it; instead some tag values should just be assumed to be referencing image URLs without using any pattern testing.

@leonardocardoso leonardocardoso merged commit ea3c0bb into leonardocardoso:main Jul 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants