We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61aa8d3 commit 63c631cCopy full SHA for 63c631c
1 file changed
lib/routes/farsnews/showcase.ts
@@ -1,8 +1,8 @@
1
-import { load } from 'cheerio';
2
import type { Route } from '@/types';
3
import cache from '@/utils/cache';
4
import got from '@/utils/got';
5
import { parseDate } from '@/utils/parse-date';
+import { load } from 'cheerio';
6
7
export const route: Route = {
8
path: '/showcase/:category?',
@@ -35,7 +35,7 @@ function extractHydrationData(html: string): any {
35
.find((html) => html?.includes('window.__hydrationDataString'));
36
37
if (hydrationScript) {
38
- const match = hydrationScript.match(/window\.__hydrationDataString\s*=\s*'([^']+)'/);
+ const match = /window\.__hydrationDataString\s*=\s*'([^']+)'/.exec(hydrationScript);
39
if (match) {
40
try {
41
return JSON.parse(match[1]);
0 commit comments