From 3a1b30afee508d6c95f1fabde983c42a18ca5f89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E6=9F=9A=E5=AD=90?=
<76462613+uuznn@users.noreply.github.com>
Date: Mon, 8 Feb 2021 15:05:39 +0800
Subject: [PATCH] Fix exturl title (#193)
---
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}`;
});
}