Skip to content

Commit

Permalink
Don’t attempt to test data uris
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonstyle committed Sep 30, 2023
1 parent 1fd67bb commit 5d1a873
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/project/types/website/util/discover-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export function findPreviewImgEl(
for (let i = 0; i < imgs.length; i++) {
const img = imgs[i] as Element;
const src = getDecodedAttribute(img, "src");
if (src !== null && kNamedFileRegex.test(src)) {
if (
src !== null && (src.startsWith("data:") || kNamedFileRegex.test(src))
) {
return img;
}
}
Expand Down

0 comments on commit 5d1a873

Please sign in to comment.