| 43 | }, |
| 44 | |
| 45 | item(node: MdNode, { entering }: Context) { |
| 46 | if (entering) { |
| 47 | const attributes: TokenAttrs = {}; |
| 48 | const classNames = []; |
| 49 | |
| 50 | if ((node as ListItemMdNode).listData.task) { |
| 51 | attributes['data-task'] = ''; |
| 52 | classNames.push('task-list-item'); |
| 53 | if ((node as ListItemMdNode).listData.checked) { |
| 54 | classNames.push('checked'); |
| 55 | attributes['data-task-checked'] = ''; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | return { |
| 60 | type: 'openTag', |
| 61 | tagName: 'li', |
| 62 | classNames, |
| 63 | attributes, |
| 64 | outerNewLine: true, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | return { |
| 69 | type: 'closeTag', |
| 70 | tagName: 'li', |
| 71 | outerNewLine: true, |
| 72 | }; |
| 73 | }, |
| 74 | |
| 75 | code(node: MdNode) { |
| 76 | const attributes = { 'data-backticks': String((node as CodeMdNode).tickCount) }; |