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

feature: text() should optionally do something intelligent with whitespace #12

Closed
flavorjones opened this issue Jan 21, 2010 · 2 comments

Comments

@flavorjones
Copy link
Owner

For example,

  Loofah.fragment("<div>foo</div><div>bar</div>").text
  => "foobar"

For block HTML elements, we should insert whitespace (maybe even newline), so that the desired output would be:

  foo bar

or

  foo
  bar
@ncancelliere
Copy link

I think most people are going to want whitespace. Given the nature of HTML blocks you'll always get an ugly result like "foobar" which isn't that useful while "foo bar" is probably what you intend to get when you grab html content.

@flavorjones
Copy link
Owner Author

commit d381674 adds #to_text to HTML::Document and HTML::DocumentFragment

This issue was closed.
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