# `Otera.TextWrap`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.1.0/lib/otera/text_wrap.ex#L1)

Python `textwrap.wrap`, for the `wordwrap` filter, with the options that the filter uses: no tab expansion, no whitespace replacement, and whitespace dropped at the start and end of the lines.

It splits the text into chunks of words and whitespace, at hyphens when `break_on_hyphens` is set, with the regular expressions of Python, and fills each line with as many chunks as fit in `width` code points.

# `wrap`

```elixir
@spec wrap(String.t(), integer(), boolean(), boolean()) :: [String.t()]
```

Wraps `text` into lines of at most `width` code points.

---

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