Created
August 9, 2020 10:44
-
-
Save tonkotsuboy/6d4db4792689aa20fa3849a9acfbd81f to your computer and use it in GitHub Desktop.
parse og:image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parseOgImage = (htmlString: string): string | null => { | |
return htmlString.match(/property="og:image" content="(?<ogimage>.*)"/iu) | |
?.groups.ogimage ?? null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment