diff --git a/lib/routes/95mm/utils.ts b/lib/routes/95mm/utils.ts index ae0de6936..b374ad0a3 100644 --- a/lib/routes/95mm/utils.ts +++ b/lib/routes/95mm/utils.ts @@ -45,7 +45,7 @@ const ProcessItems = async (ctx, title, currentUrl) => { const images = detailResponse.data.match(/src": '(.*?)',"width/g); item.description = art(path.join(__dirname, 'templates/description.art'), { - images: images.map((i) => i.split("'")[1].replaceAll('\\/', '/')), + images: images.map((i) => i.split("'")[1].replaceAll(String.raw`\/`, '/')), }); return item; diff --git a/lib/routes/abc/index.ts b/lib/routes/abc/index.ts index bd3075455..4dd9d046b 100644 --- a/lib/routes/abc/index.ts +++ b/lib/routes/abc/index.ts @@ -126,7 +126,7 @@ async function handler(ctx) { item.title = content('meta[property="og:title"]').prop('content'); item.description = ''; - const enclosurePattern = '"(?:MIME|content)?Type":"([\\w]+/[\\w]+)".*?"(?:fileS|s)?ize":(\\d+),.*?"url":"([\\w-.:/?]+)"'; + const enclosurePattern = String.raw`"(?:MIME|content)?Type":"([\w]+/[\w]+)".*?"(?:fileS|s)?ize":(\d+),.*?"url":"([\w-.:/?]+)"`; const enclosureMatches = detailResponse.match(new RegExp(enclosurePattern, 'g')); diff --git a/lib/routes/bloomberg/utils.ts b/lib/routes/bloomberg/utils.ts index 6a0ef7cd4..92daa603c 100644 --- a/lib/routes/bloomberg/utils.ts +++ b/lib/routes/bloomberg/utils.ts @@ -85,9 +85,9 @@ const parseNewsList = async (url, ctx) => { .map((u) => { u = $(u); const item = { - title: u.find('news\\:title').text(), + title: u.find(String.raw`news\:title`).text(), link: u.find('loc').text(), - pubDate: parseDate(u.find('news\\:publication_date').text()), + pubDate: parseDate(u.find(String.raw`news\:publication_date`).text()), }; return item; }); diff --git a/lib/routes/dedao/list.ts b/lib/routes/dedao/list.ts index 182608a90..28e11dd69 100644 --- a/lib/routes/dedao/list.ts +++ b/lib/routes/dedao/list.ts @@ -44,7 +44,7 @@ async function handler(ctx) { url: listUrl, }); - const currentUrl = `${rootUrl}${listResponse.data.match(new RegExp('' + category + '<\\/span>