feat: use item link as absolute link base

This commit is contained in:
DIYgod 2019-08-28 15:12:17 +08:00
parent 56566ef62d
commit 84fdea3d1e
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ module.exports = async (ctx, next) => {
// absolute link
if (ctx.state.data.link) {
$ele.attr('href', new URL($ele.attr('href'), ctx.state.data.link).href);
$ele.attr('href', new URL($ele.attr('href'), item.link || ctx.state.data.link).href);
}
});
@ -66,7 +66,7 @@ module.exports = async (ctx, next) => {
// absolute link
if (ctx.state.data.link) {
$ele.attr('src', new URL($ele.attr('src'), ctx.state.data.link).href);
$ele.attr('src', new URL($ele.attr('src'), item.link || ctx.state.data.link).href);
}
// referrerpolicy