mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-31 19:51:36 +08:00

git-subtree-dir: packages/turndown-plugin-gfm git-subtree-mainline: ebebdd0b07edda953fdc71b0003c223a6531e05c git-subtree-split: 0f43299c17108e9508e7e6237369e86f504ea60a
11 lines
322 B
JavaScript
11 lines
322 B
JavaScript
export default function taskListItems (turndownService) {
|
|
turndownService.addRule('taskListItems', {
|
|
filter: function (node) {
|
|
return node.type === 'checkbox' && node.parentNode.nodeName === 'LI'
|
|
},
|
|
replacement: function (content, node) {
|
|
return (node.checked ? '[x]' : '[ ]') + ' '
|
|
}
|
|
})
|
|
}
|