hexo-theme-butterfly
Version:
A Simple and Card UI Design theme for Hexo
19 lines (14 loc) • 433 B
JavaScript
/**
* Butterfly
* mermaid
* https://github.com/mermaid-js/mermaid
*/
const { escapeHTML } = require('hexo-util')
const mermaid = (args, content) => {
const config = args[0] || '{}'
return `<div class="mermaid-wrap"><pre class="mermaid-src" data-config="${escapeHTML(config)}" hidden>
${escapeHTML(content)}
</pre></div>`
}
hexo.extend.tag.register('mermaid', mermaid, { ends: true })