mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Fix exturl title (#193)
This commit is contained in:
parent
941e9817c6
commit
3a1b30afee
@ -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 `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}" title="${title[1]}">${html}<i class="fa fa-external-link-alt"></i></span>`;
|
||||
|
||||
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}">${html}<i class="fa fa-external-link-alt"></i></span>`;
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user