1
0
Fork 0
mirror of synced 2024-12-27 17:13:21 -05:00
ultimate-vim/sources_non_forked/markdown-preview.nvim/app/pages/meta.js

26 lines
489 B
JavaScript
Raw Normal View History

2022-05-19 08:12:11 -04:00
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: []
}
);
};
}