nomagick commited on
Commit
1bd3ed7
·
unverified ·
1 Parent(s): 6e05ea2

fix: description from jsdom

Browse files
backend/functions/src/services/jsdom.ts CHANGED
@@ -137,10 +137,11 @@ export class JSDomControl extends AsyncService {
137
  .filter(Boolean);
138
 
139
  const imageSet = new Set(imageTags);
140
-
141
  const r = {
142
  ...snapshot,
143
  title: snapshot.title || jsdom.window.document.title,
 
 
144
  parsed,
145
  html: rootDoc.documentElement.outerHTML,
146
  text: textChunks.join('\n'),
 
137
  .filter(Boolean);
138
 
139
  const imageSet = new Set(imageTags);
 
140
  const r = {
141
  ...snapshot,
142
  title: snapshot.title || jsdom.window.document.title,
143
+ description: snapshot.description ||
144
+ (jsdom.window.document.head?.querySelector('meta[name="description"]')?.getAttribute('content') ?? ''),
145
  parsed,
146
  html: rootDoc.documentElement.outerHTML,
147
  text: textChunks.join('\n'),