-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
#to_text should preserve whitespace between inline elements #71
Comments
An example of what I was hoping for: html_text = "example:<a href=\"http://url.com/index.html\">http://url.com/index.html</a><a href=\"http://url.com/index2.html\">http://url.com/index2.html</a>"
Loofah.fragment(html_text).to_text Expected: Actual: Similarly, html_text = "example:<br><a href=\"http://url.com/index.html\">http://url.com/index.html</a><br><a href=\"http://url.com/index2.html\">http://url.com/index2.html</a>"
Loofah.fragment(html_text).to_text Expected: Actual: |
I'd love to have this too. |
I set the gem's version to github and found that it's supported! Also, note that you need to call the method |
I'm open to a PR of some sort that generates output as you describe. Let me know if you'd like direction or advice? |
@flavorjones I love the that #to_text preserves whitespace (as you added here #12), but it doesn't appear to preserve between inline elements as you say in this post (sparklemotion/nokogiri#636), only block elements. Would it be reasonable for it to preserve whitespace between inline elements? Am I missing an option to do this? If not, would you be open to a pull request to make this happen?
The text was updated successfully, but these errors were encountered: