hexo-theme-volantis
Version:
Elegant and powerful theme for Hexo.
32 lines (29 loc) • 686 B
JavaScript
/**
* 上次修改更新:5.0 | https://github.com/volantis-x/hexo-theme-volantis
*
*/
;
function postP(args) {
if (/::/g.test(args)) {
args = args.join(' ').split('::');
}
else {
args = args.join(' ').split(',');
}
const p0 = args[0].trim();
const p1 = args[1].trim();
return `<p class='p ${p0}'>${p1}</p>`;
}
function postSpan(args) {
if (/::/g.test(args)) {
args = args.join(' ').split('::');
}
else {
args = args.join(' ').split(',');
}
const p0 = args[0].trim();
const p1 = args[1].trim();
return `<span class='p ${p0}'>${p1}</span>`;
}
hexo.extend.tag.register('p', postP);
hexo.extend.tag.register('span', postSpan);