MCPcopy
hub / github.com/nhn/tui.editor / item

Function item

apps/editor/src/markdown/htmlRenderConvertors.ts:45–73  ·  view source on GitHub ↗
(node: MdNode, { entering }: Context)

Source from the content-addressed store, hash-verified

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) };

Callers

nothing calls this directly

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected