From c43db1e8746c442ef5bcaab6d36d849c8a6114eb Mon Sep 17 00:00:00 2001 From: Dave Lucia Date: Thu, 17 Nov 2022 11:21:26 -0500 Subject: [PATCH] Fix dialyzer issues with Floki.text/1 (#437) 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() ``` --- lib/floki.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/floki.ex b/lib/floki.ex index a58b5ca2..10bd4905 100644 --- a/lib/floki.ex +++ b/lib/floki.ex @@ -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 =