Markdown Task Lists
Task lists (also known as checklists) allow you to create a list of items with checkboxes next to them. This is a popular feature of "GitHub Flavored Markdown" (GFM).
When rendered into HTML, these usually appear as unordered list items with an input element of type checkbox.
Creating a Task List
To create a task list, use a dash followed by a space and then brackets with a space (for an unchecked item) or an "x" (for a checked item).
- [ ]Unchecked item- [x]Checked item
Nested Task Lists
You can also nest task lists just like you would with regular lists by indenting the items.
Important Considerations
- Spaces Matter: Ensure there is a space between the dash and the brackets, and if the task is unchecked, ensure there is a space inside the brackets. If you forget these spaces, the parser will likely just render the text literally.
- Interactivity: While most Markdown editors (including ours) allow you to toggle the "x" in the source code, the rendered checkboxes in a static HTML page are often "read-only" unless you add additional JavaScript to handle the state changes.
- Support: Task lists are a feature of Extended Markdown (like GFM). While very common, very basic Markdown parsers might not support them.