@sylphx/synth-md-gfm
v0.2.3
Published
GitHub Flavored Markdown (GFM) extensions for Synth
Readme
@sylphx/synth-md-gfm
GitHub Flavored Markdown (GFM) extensions for Synth.
Installation
npm install @sylphx/synth @sylphx/synth-md @sylphx/synth-md-gfmFeatures
- Tables with column alignment
- Strikethrough text (~~deleted~~)
- Autolinks for URLs and emails
- Task lists with checkboxes
Usage
import { parse } from '@sylphx/synth-md'
import { gfmPlugin } from '@sylphx/synth-md-gfm'
const markdown = `
# GFM Examples
## Tables
| Feature | Supported |
|---------|:---------:|
| Tables | ✓ |
| Align | ✓ |
## Strikethrough
This is ~~deleted~~ text.
## Autolinks
Visit https://github.com
## Task Lists
- [x] Completed task
- [ ] Pending task
`
const tree = parse(markdown, { plugins: [gfmPlugin()] })Options
interface GFMPluginOptions {
tables?: boolean // Enable tables (default: true)
strikethrough?: boolean // Enable ~~text~~ (default: true)
autolinks?: boolean // Enable URL autolinks (default: true)
taskLists?: boolean // Enable task lists (default: true)
}GFM Specification
This plugin implements the GitHub Flavored Markdown Spec:
Tables
| Left | Center | Right |
|:-----|:------:|------:|
| A | B | C |- Column alignment with
:---,:---:,---: - Header row required
- Separator row required
Strikethrough
~~This text is deleted~~Autolinks
https://example.com
[email protected]Automatically converts URLs and emails to links.
Task Lists
- [x] Completed
- [ ] TodoCheckbox syntax for task items.
