mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-24 23:42:40 +08:00
fix(routes/lovelive-anime): correct relative img URL resolving (#19916)
This fixes img URL for base url ending with slash (`topics/` or `news/`)
This commit is contained in:
@@ -109,12 +109,11 @@ async function handler(ctx) {
|
||||
const pubDate = timezone(parseDate(item.find('a > p.date').text(), 'YYYY/MM/DD'), +9);
|
||||
const title = item.find('a > p.title').text();
|
||||
const category = item.find('a > p.category').text();
|
||||
const imglink = `${rootUrl}/${
|
||||
item
|
||||
.find('a > img')
|
||||
.attr('style')
|
||||
.match(/background-image:url\((.*)\)/)[1]
|
||||
}`;
|
||||
const relativeImgLink = item
|
||||
.find('a > img')
|
||||
.attr('style')
|
||||
.match(/background-image:url\((.*)\)/)[1];
|
||||
const imglink = new URL(relativeImgLink, baseUrl).href;
|
||||
|
||||
return {
|
||||
link,
|
||||
|
||||
Reference in New Issue
Block a user