@generative-dom/plugin-markdown-base
v0.1.1
Published
Generative DOM plugin — paragraphs, line breaks, escaping, and horizontal rules
Downloads
71
Maintainers
Readme
@generative-dom/plugin-markdown-base
Fallback block plugin: paragraphs, horizontal rules, and blank lines.
Installation
pnpm add @generative-dom/plugin-markdown-baseUsage
import { GenerativeDom } from '@generative-dom/core';
import { markdownBase } from '@generative-dom/plugin-markdown-base';
const md = new GenerativeDom(container, { plugins: [markdownBase()] });
md.push('Hello world\n\n---\n');Matching
This is the catch-all plugin. Anything not claimed by a higher-priority plugin lands here.
Horizontal rule — a line of three or more -, *, or _ characters with optional spaces:
---
* * *
___Blank line — one or more lines containing only whitespace. Consumed silently, no DOM output.
Paragraph — any consecutive non-blank lines. The paragraph ends at a blank line or end of input. Lines are joined with a newline and passed to inline parsing.
Configuration
- priority: 300 (lowest — always last)
- level: block (default)
- matchDescriptor: none (matches everything remaining)
Rendered Output
| Input | Output |
|-------|--------|
| Paragraph text | <p> with inline-parsed children |
| --- / *** / ___ | <hr> |
| Blank line | no DOM node |
