Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM tree to HTML #32

Closed
glaucocustodio opened this issue Oct 3, 2015 · 5 comments
Closed

DOM tree to HTML #32

glaucocustodio opened this issue Oct 3, 2015 · 5 comments

Comments

@glaucocustodio
Copy link
Contributor

Hi guys, if I do Floki.find(html, "#wrapper") for instance I very likely will get a lot of sub DOM elements, can't I convert it to HTML? I just saw Floki.text, but I dont want just text.

Something like:
Floki.find(html, "#wrapper") |> Floki.raw_html
Result:
<div id="wrapper">... children DOM here ...</div>

@philss
Copy link
Owner

philss commented Oct 4, 2015

@glaucocustodio this functionality does not exist yet. But I'm considering add it.

The main problem today is that mochiweb, which is the lib that really does the parsing of HTML, does not consider some spaces as text nodes. This problem was reported in this issue: #14

So, the resultant HTML would be different from the original one.

@glaucocustodio
Copy link
Contributor Author

I've added this functionality, please check #33. Let me know if it's all ok.

@philss
Copy link
Owner

philss commented Oct 7, 2015

Closed by #33

Thanks @glaucocustodio!

@philss philss closed this as completed Oct 7, 2015
@philss
Copy link
Owner

philss commented Oct 8, 2015

@glaucocustodio Version 0.6 released with this new feature. Enjoy! :)

@glaucocustodio
Copy link
Contributor Author

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants