# `Prosody.TextParser`
[🔗](https://github.com/halostatue/prosody/blob/v1.1.0/lib/prosody/text_parser.ex#L1)

Plain text content parser for the Prosody content analysis library. This module provides
fallback behaviour for plain text content or unknown markup formats.

# `parse`
[🔗](https://github.com/halostatue/prosody/blob/v1.1.0/lib/prosody/text_parser.ex#L34)

Parse plain text content (from `t:String.t/0`) into linear `t:Prosody.block/0` entries.
Returns `{:ok, blocks}` or `{:error, reason}`.

## Options

  - `:strip_frontmatter` (default: `true`): Whether to strip YAML frontmatter.

## Examples

```elixir
iex> Prosody.TextParser.parse("Hello world!")
{:ok, [
  %{type: :text, content: "Hello world!", language: nil, metadata: %{}}
]}

iex> Prosody.TextParser.parse("Text with code blocks")
{:ok, [
  %{type: :text, content: "Text with code blocks", language: nil, metadata: %{}}
]}
```

# `parse!`
[🔗](https://github.com/halostatue/prosody/blob/v1.1.0/lib/prosody/text_parser.ex#L63)

Parse plain text content (from `t:String.t/0`) into linear `t:Prosody.block/0` entries.
Returns `blocks` or raises an error.

## Options

  - `:strip_frontmatter` (default: `true`): Whether to strip YAML frontmatter.

## Examples

```elixir
iex> Prosody.TextParser.parse!("Hello world!")
[%{type: :text, content: "Hello world!", language: nil, metadata: %{}}]

iex> Prosody.TextParser.parse!("Text with code blocks")
[%{type: :text, content: "Text with code blocks", language: nil, metadata: %{}}]
```

---

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