forked from Mirrors/elk
fix: expand og:image regexp
This commit is contained in:
parent
797b99f122
commit
bb013ddd18
1 changed files with 2 additions and 2 deletions
|
@ -18,8 +18,8 @@ function getOpenGraphClient(): OpenGraphClient {
|
|||
}
|
||||
|
||||
function extractOgImageUrl(html: string): string {
|
||||
const match = html.match(/<meta property="og:image" content="([^"]+)" \/>/)
|
||||
return match?.[1] ?? ''
|
||||
const match = html.match(/<meta[^>]*property="og:image"[^>]*content="([^"]+)"|<meta[^>]*content="([^"]+)"[^>]*property="og:image"/)
|
||||
return match?.[1] ?? match?.[2] ?? ''
|
||||
}
|
||||
|
||||
async function resolveOgImageUrlManually(cardUrl: string): Promise<string> {
|
||||
|
|
Loading…
Reference in a new issue