hexo-theme-volantis
Version:
Elegant and powerful theme for Hexo.
28 lines (25 loc) • 595 B
JavaScript
;
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);