fix: description from jsdom

This commit is contained in:
Yanlong Wang 2024-09-12 19:09:19 +08:00
parent 6e05ea2243
commit 1bd3ed7125
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -137,10 +137,11 @@ export class JSDomControl extends AsyncService {
.filter(Boolean);
const imageSet = new Set(imageTags);
const r = {
...snapshot,
title: snapshot.title || jsdom.window.document.title,
description: snapshot.description ||
(jsdom.window.document.head?.querySelector('meta[name="description"]')?.getAttribute('content') ?? ''),
parsed,
html: rootDoc.documentElement.outerHTML,
text: textChunks.join('\n'),