Created
February 14, 2014 00:24
-
-
Save dannguyen/8986870 to your computer and use it in GitHub Desktop.
How to use the Loofah library with a Nokogiri node to preserve line breaks between block elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npage = Nokogiri::HTML(html) | |
h[:text] = Loofah.fragment(npage.search('.displaytext').to_html).to_text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment