nuxt-og-image 2.0.0-beta.3 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -5
- package/dist/runtime/nitro/utils-pure.mjs +7 -5
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -185,11 +185,13 @@ function extractOgImageOptions(html) {
|
|
|
185
185
|
console.warn("Failed to parse #nuxt-og-image-options", e, options);
|
|
186
186
|
}
|
|
187
187
|
if (options) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
if (!options.description) {
|
|
189
|
+
const description = html.match(/<meta property="og:description" content="(.*?)">/)?.[1];
|
|
190
|
+
if (description)
|
|
191
|
+
options.description = description;
|
|
192
|
+
else
|
|
193
|
+
options.description = html.match(/<meta name="description" content="(.*?)">/)?.[1];
|
|
194
|
+
}
|
|
193
195
|
return decodeHtmlEntities(options);
|
|
194
196
|
}
|
|
195
197
|
return false;
|
|
@@ -19,11 +19,13 @@ export function extractOgImageOptions(html) {
|
|
|
19
19
|
console.warn("Failed to parse #nuxt-og-image-options", e, options);
|
|
20
20
|
}
|
|
21
21
|
if (options) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
if (!options.description) {
|
|
23
|
+
const description = html.match(/<meta property="og:description" content="(.*?)">/)?.[1];
|
|
24
|
+
if (description)
|
|
25
|
+
options.description = description;
|
|
26
|
+
else
|
|
27
|
+
options.description = html.match(/<meta name="description" content="(.*?)">/)?.[1];
|
|
28
|
+
}
|
|
27
29
|
return decodeHtmlEntities(options);
|
|
28
30
|
}
|
|
29
31
|
return false;
|