Skip to content

task()

ts
function task(checked, node): Node;

Defined in: task.ts:33

Builder-element for a task list item

Parameters

ParameterTypeDescription
checkedbooleanWhether the task is checked
nodestring | NodeContent of this element

Returns

Node

A markdown node

Example

ts
import { define, task, list } from "@ogs-gmbh/markdown";

const markdown = define(
  list(
    "unordered",
    task(true, "Finish project"),
    task(false, "Start weekend")
  )
);

console.assert(
  markdown.toString()
);

See

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists

Since

1.0.0

Author

Simon Kovtyk