Fix pandoc rendering error

* See: https://github.com/next-theme/hexo-theme-next/issues/12
This commit is contained in:
Mimi 2020-05-28 11:22:08 +08:00
parent 898e7b9cab
commit 17502dacf4
3 changed files with 7 additions and 9 deletions

View File

@ -8,10 +8,10 @@
function centerQuote(args, content) {
return `<blockquote class="blockquote-center">
<i class="fa fa-quote-left"></i>
${hexo.render.renderSync({ text: content, engine: 'markdown' })}
<i class="fa fa-quote-right"></i>
</blockquote>`;
<i class="fa fa-quote-left"></i>
${hexo.render.renderSync({ text: content, engine: 'markdown' })}
<i class="fa fa-quote-right"></i>
</blockquote>`;
}
hexo.extend.tag.register('centerquote', centerQuote, {ends: true});

View File

@ -7,9 +7,7 @@
'use strict';
function postNote(args, content) {
return `<div class="note ${args.join(' ')}">
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
</div>`;
return `<div class="note ${args.join(' ')}">${hexo.render.renderSync({text: content, engine: 'markdown'})}</div>`;
}
hexo.extend.tag.register('note', postNote, {ends: true});

View File

@ -35,14 +35,14 @@ function postTabs(args, content) {
postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'}).trim();
tabId += 1;
tabId++;
tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-');
((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId);
var isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? ' style="text-align: center;"' : '';
let icon = tabIcon.trim();
icon = icon.startsWith('fa') ? icon : 'fa fa-' + icon;
if (!icon.startsWith('fa')) icon = 'fa fa-' + icon;
tabIcon.length > 0 && (tabIcon = `<i class="${icon}"${isOnlyicon}></i>`);
var isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : '';