@generative-dom/plugin-markdown-list
v0.1.0
Published
Generative DOM plugin — ordered and unordered lists
Maintainers
Readme
@generative-dom/plugin-markdown-list
Ordered and unordered lists for Generative DOM.
Installation
pnpm add @generative-dom/plugin-markdown-listUsage
import { GenerativeDom } from '@generative-dom/core';
import { markdownBase } from '@generative-dom/plugin-markdown-base';
import { markdownList } from '@generative-dom/plugin-markdown-list';
const md = new GenerativeDom(container, { plugins: [markdownBase(), markdownList()] });
md.push('- one\n- two\n- three\n');Matching
Unordered list — items starting with -, *, or + followed by a space:
- item one
* item two
+ item threeOrdered list — items starting with up to nine digits followed by . or ) and a space:
1. first
2. second
3) thirdContinuation lines (indented more than the base indent) are appended to the current item.
A blank line between items makes the list "loose" (items wrapped in <p>).
The list ends at the first non-list, non-continuation line.
Configuration
- priority: 100
- level: block (default)
- matchDescriptor:
{ startChars: '-*+0123456789 \t' }
Rendered Output
| List type | Container | Item wrapper (tight) | Item wrapper (loose) |
|-----------|-----------|----------------------|----------------------|
| Unordered | <ul> | <li> | <li><p> |
| Ordered | <ol> | <li> | <li><p> |
Item text is inline-parsed for formatting.
