Skip to content

Commit

Permalink
Fix dialyzer issues with Floki.text/1 (#437)
Browse files Browse the repository at this point in the history
If you pass a node directly, you'll get an error like

```
The function call will not succeed.

Floki.text(_block :: {<<_::8>>, binary() | [{binary(), binary()}], [any()]})

breaks the contract
(html_tree() | binary()) :: binary()
```
  • Loading branch information
davydog187 authored Nov 17, 2022
1 parent 3c1ce6e commit c43db1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/floki.ex
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ defmodule Floki do
"""

@spec text(html_tree | binary) :: binary
@spec text(html_tree | html_node | binary) :: binary

def text(html, opts \\ [deep: true, js: false, style: true, sep: ""]) do
cleaned_html_tree =
Expand Down

0 comments on commit c43db1e

Please sign in to comment.