Overview
This utility configures Marked.js with a custom renderer for task list items, ensuring proper HTML structure for checkbox lists.Import
Functions
marked.parse()
Parses markdown text and converts it to HTML using the configured custom renderers.The markdown text to parse
Optional configuration object for parsing behavior
The rendered HTML output
Custom Renderers
Task List Renderer
The customlistitem renderer handles task list items with proper label wrapping:
- Detects task list items (checkboxes)
- Wraps content in
<li class='task-list-item'> - Ensures
<label>tag is properly positioned - Returns
falsefor non-task list items (uses default renderer)
Usage Example
Related
- Used in:
src/lib/notion-parse.tsfor converting Notion blocks to HTML - Source:
src/lib/marked.ts:1