From 29771212875e456f806a412362358acf71ee6b0f Mon Sep 17 00:00:00 2001 From: uuznn Date: Tue, 2 Feb 2021 00:12:16 +0800 Subject: [PATCH] fix(exturl): Return encrypted URL with title. --- scripts/filters/post.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/filters/post.js b/scripts/filters/post.js index f1ea4cbd9..d40cef2d7 100644 --- a/scripts/filters/post.js +++ b/scripts/filters/post.js @@ -21,6 +21,10 @@ hexo.extend.filter.register('after_post_render', data => { const link = parse(href); if (!link.protocol || link.hostname === siteHost) return match; + // Return encrypted URL with title. + const title = match.match(/title="([^"]+)"/); + if (title) return `${html}`; + return `${html}`; }); }