philss / floki

Floki is a simple HTML parser that enables search for nodes using CSS selectors.
https://hex.pm/packages/floki
MIT License
2.07k stars 156 forks source link

invalid output type in spec for traverse_and_update/3 #252

Closed RichMorin closed 4 years ago

RichMorin commented 4 years ago

Although traverse_and_update/3 seems to work nicely, it breaks mix dialyzer for me. The problem is that the output type (as documented here) is specified as html_tree. It should be specified as (something like) {html_tree, any}.

RichMorin commented 4 years ago

I think line 391 of https://github.com/philss/floki/blob/master/lib/floki.ex needs to be something like:

     ) :: {html_tree(), traverse_acc()}

I've tried this and it seems to clear up the problem.

philss commented 4 years ago

Closed by #255