Skip to content

Commit 0953e22

Browse files
committed
fix: fix regexp match
1 parent f8cbb42 commit 0953e22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/renderer/renderer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ func waitForMetaFinalization(page *rod.Page) (string, error) {
167167
}
168168

169169
// Regex to extract meta content attributes
170-
// Matches: <meta property="og:image" ... content="...">
170+
// Matches either attribute form:
171+
// <meta property="og:image" content="..."> OR <meta name="og:image" content="...">
171172
// Note: We intentionally ignore twitter:image for stabilization. The renderer remains generic
172173
// and will only loop for stability when an og:image is present.
173-
ogRe := regexp.MustCompile(`(?i)<meta[^>]+property=["']og:image["'][^>]*content=["']([^"']+)["'][^>]*>`) //nolint:lll
174+
ogRe := regexp.MustCompile(`(?i)<meta[^>]+(?:property|name)=["']og:image["'][^>]*content=["']([^"']+)["'][^>]*>`) //nolint:lll
174175

175176
deadline := time.Now().Add(timeout)
176177
ticker := time.NewTicker(500 * time.Millisecond)

0 commit comments

Comments
 (0)