Is there a way to replace paragraph tags by newlines in Floki.text()?
BlackEdder opened this issue · 1 comments
BlackEdder commented
I would like to use Floki to cleanup/parse html and output a normal utf8 string. I have been able to do that using
html |> Floki.parse_fragment!() |> Floki.text()
but would prefer paragraphs <p>text</p>
to be followed by a newline when calling Floki.text()
. I did try Floki.text([sep: "\n"])
but that results in new lines being inserted too readily.
philss commented
@BlackEdder have you tried with Floki.traverse_and_update/2
?