MCPcopy
hub / github.com/docsifyjs/docsify / taskListCompiler

Function taskListCompiler

src/core/render/compiler/taskList.js:1–16  ·  view source on GitHub ↗
({ renderer })

Source from the content-addressed store, hash-verified

1export const taskListCompiler = ({ renderer }) =>
2 (renderer.list = (body, ordered, start) => {
3 const isTaskList = /<li class="task-list-item">/.test(
4 body.split('class="task-list"')[0]
5 );
6 const isStartReq = start && start > 1;
7 const tag = ordered ? 'ol' : 'ul';
8 const tagAttrs = [
9 isTaskList ? 'class="task-list"' : '',
10 isStartReq ? `start="${start}"` : '',
11 ]
12 .join(' ')
13 .trim();
14
15 return `<${tag} ${tagAttrs}>${body}</${tag}>`;
16 });

Callers 1

_initRendererMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…