Skip to content

Commit 172f6cf

Browse files
authored
fix(route): fix radio canada by fixing regular expression to match correct data (#14630)
1 parent cd6f2d9 commit 172f6cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/routes/radio-canada/latest.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export default async (ctx) => {
3131
});
3232

3333
const $ = load(detailResponse.data);
34-
const rcState = $('script:contains("window._rcState_ = JSON.parse")')
34+
const rcState = $('script:contains("window._rcState_ = ")')
3535
.text()
36-
.match(/JSON\.parse\((".*")\);/)[1];
37-
const rcStateJson = JSON.parse(JSON.parse(rcState));
36+
.match(/window\._rcState_ = (.*);/)[1];
37+
const rcStateJson = JSON.parse(rcState);
3838
const news = Object.values(rcStateJson.pagesV2.pages)[0];
3939
item.description = news.data.newsStory.body.html.replaceAll('\\n', '<br>');
4040

0 commit comments

Comments
 (0)