# `Md.Listener`
[🔗](https://github.com/am-kantox/md/blob/v0.12.0/lib/md/listener.ex#L1)

The listener behaviour to attach to the parser to receive callbacks
when the elements are encountered and processed.

# `attributes`

```elixir
@type attributes() :: XmlBuilder.Element.attrs()
```

# `branch`

```elixir
@type branch() :: XmlBuilder.Element.content()
```

# `callback`

```elixir
@type callback() :: (state() -&gt; state())
```

# `context`

```elixir
@type context() ::
  :start
  | :break
  | :linefeed
  | :whitespace
  | :custom
  | {:substitute, {binary(), binary()}}
  | {:esc, binary()}
  | {:char, binary()}
  | {:tag, {binary(), element()}, atom()}
  | :finalize
  | :end
```

# `element`

```elixir
@type element() :: XmlBuilder.Element.name()
```

# `leaf`

```elixir
@type leaf() :: XmlBuilder.Element.content()
```

# `parse_mode`

```elixir
@type parse_mode() ::
  :idle
  | :finished
  | :raw
  | :skip
  | :comment
  | :magnet
  | :md
  | {:outer, :md}
  | {:linefeed, non_neg_integer()}
  | {:nested, element(), non_neg_integer()}
  | {:inner, :raw}
  | {:inner, element(), non_neg_integer()}
```

# `state`

```elixir
@type state() :: %Md.Parser.State{
  path: [trace()],
  mode: [parse_mode()],
  type: module(),
  ast: [branch()],
  listener: nil | module(),
  payload: any(),
  bag: %{indent: [non_neg_integer()], stock: [branch()], deferred: [binary()]}
}
```

# `trace`

```elixir
@type trace() :: branch()
```

# `element`

```elixir
@callback element(context(), state()) :: :ok | {:update, state()}
```

---

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