turndown-plugin-showdown
Version:
Turndown plugin based on the Showdow library
12 lines (11 loc) • 350 B
JavaScript
function taskLists (turndownService) {
turndownService.addRule('taskLists', {
filter: function (node) {
return node.type === 'checkbox' && node.parentNode.nodeName === 'LI'
},
replacement: function (content, node) {
return (node.checked ? '[x]' : '[ ]');
}
});
}
module.exports = taskLists;