# `Noizu.Comms.Markdown`
[🔗](https://github.com/noizu-labs-sdks/elixir-comms/blob/main/lib/lib/noizu/comms/markdown.ex#L1)

CommonMark subset parsed once, rendered per channel dialect.

Supported inline syntax: `**bold**`, `*italic*`, `` `code` ``, fenced code
blocks (` ``` ` with optional language line), and `[text](url)` links.
Everything else passes through as plain text.

| dialect | bold | italic | link | plain-text escaping |
|---|---|---|---|---|
| `:discord` | `**x**` | `*x*` | `[t](u)` | none (native markdown) |
| `:slack` | `*x*` | `_x_` | `<u\|t>` | `& < >` entity-escaped |
| `:telegram` | `*x*` | `_x_` | `[t](u)` | MarkdownV2 escape set |
| `:whatsapp` | `*x*` | `_x_` | `t (u)` | none |

# `segment`

```elixir
@type segment() ::
  {:text, String.t()}
  | {:bold, [segment()]}
  | {:italic, [segment()]}
  | {:code, String.t()}
  | {:code_block, String.t()}
  | {:link, [segment()], String.t()}
```

# `parse`

```elixir
@spec parse(String.t()) :: [segment()]
```

Parses markdown text into a segment tree (blocks flattened in order).

# `render_to`

```elixir
@spec render_to(String.t() | [segment()], atom()) :: String.t()
```

Renders markdown (raw text or segments) for a dialect.

# `to_discord`

# `to_slack`

# `to_telegram`

# `to_whatsapp`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
