mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-06-06 05:11:45 +08:00
fix: 修復網站壓縮後,mermaid 會無法生成顯示的Bugs
feat: Valine 增加 option 設置
This commit is contained in:
@@ -71,7 +71,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
lazySrc +
|
||||
'="' +
|
||||
this.url_for(cover) +
|
||||
'">'
|
||||
'" alt="cover">'
|
||||
if (dateType === 'created') {
|
||||
result +=
|
||||
'<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i>' +
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const { escapeHTML } = require('hexo-util')
|
||||
|
||||
function mermaid (args, content) {
|
||||
return `<div class="mermaid">${content}</div>`
|
||||
return `<div class="mermaid">${escapeHTML(content)}</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
||||
|
||||
Reference in New Issue
Block a user