From 9ccd7ccf7f8d2a2813fe26efceb96fa402055bb9 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 f1ea4cbd9a..d40cef2d76 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}`;
});
}