How do I convert string content to markdown in a tag?
{% custom %}
Make text **markdown**
{% endcustom %}
hexo.extend.tag.register('custom', function(args, content) {
// render content in markdown before return
return '<blockquote>' + content + '</blockquote>';
}, {ends: true});
Right now the above returns:
<blockquote>Make text **markdown**</blockquote>
And I want it to return this:
<blockquote>Make text <strong>markdown</strong></blockquote>
I figured it out.
hexo.extend.tag.register('custom', function(args, content) {
content = hexo.render.renderSync({text: content, engine: 'markdown'});
return '<blockquote>' + content + '</blockquote>';
}, {ends: true});
Most helpful comment
I figured it out.