GitHub-flavoured Markdown → Slack mrkdwn. Deterministic, line-based, no deps.
| Markdown | mrkdwn |
|---|---|
# Heading (any level) | *Heading* |
**bold** / __bold__ | *bold* |
*em* | _em_ |
~~strike~~ | ~strike~ |
[text](url) /  / <url> | <url|text> / <url|alt> / <url> |
- item / * item / + item | • item (nested: 4 spaces per level) |
- [ ] todo / - [x] done | • ☐ todo / • ☑ done |
1. item | 1. item |
> quote | > quote |
--- | a rule line |
| fenced code | ``` fences kept (language tag dropped), body verbatim |
inline code | kept |
| tables | monospace (fenced) block with padded columns |
| HTML tags | stripped (<br> → newline) |
&, <, > in text are escaped as Slack requires (escape: false disables).
Runs of blank lines collapse to one.
Summary
Functions
Converts GitHub-flavoured markdown to Slack mrkdwn. Options: :escape (default true).
Converts markdown and splits it into section blocks, each within the section text
limit (:max_chars, default 3000). Splits prefer paragraph boundaries, then line
boundaries; code fences are re-opened/closed across splits. Returns a plain list —
run it through Noizu.Slack.Blocks.validate/1 to enforce the 50-block cap.
Functions
Converts GitHub-flavoured markdown to Slack mrkdwn. Options: :escape (default true).
@spec to_blocks(String.t(), keyword()) :: [Noizu.Slack.Blocks.block()]
Converts markdown and splits it into section blocks, each within the section text
limit (:max_chars, default 3000). Splits prefer paragraph boundaries, then line
boundaries; code fences are re-opened/closed across splits. Returns a plain list —
run it through Noizu.Slack.Blocks.validate/1 to enforce the 50-block cap.