diff --git a/scripts/filters/post.js b/scripts/filters/post.js index 87e7026..511de93 100644 --- a/scripts/filters/post.js +++ b/scripts/filters/post.js @@ -3,6 +3,7 @@ 'use strict'; const { parse } = require('url'); +const { unescapeHTML } = require('hexo-util'); hexo.extend.filter.register('after_post_render', data => { const { config } = hexo; @@ -25,9 +26,10 @@ hexo.extend.filter.register('after_post_render', data => { // Return encrypted URL with title. const title = match.match(/title="([^"]+)"/); - if (title) return `${html}${exturlIcon}`; + const encoded = Buffer.from(unescapeHTML(href)).toString('base64'); + if (title) return `${html}${exturlIcon}`; - return `${html}${exturlIcon}`; + return `${html}${exturlIcon}`; }); }