1
0
Fork 0
mirror of synced 2024-12-27 00:53:20 -05:00
ultimate-vim/sources_non_forked/markdown-preview.nvim/app/pages/meta.js
2022-05-19 20:12:11 +08:00

25 lines
489 B
JavaScript

import getRender from 'md-it-meta/lib/meta'
export const meta = separates => {
if (separates === void 0) {
separates = [['---'], ['---']]
}
return (md) => {
const render = getRender(md, separates)
md.meta = md.meta || {}
md.block.ruler.before(
'code',
'meta',
(...args) => {
try {
return render(...args)
} catch(e) {
console.log('md-it-meta', e)
}
},
{
alt: []
}
);
};
}