I am using Nokogiri with Ruby on Rails v2.3.8.
Is there a way in which I can avoid pretty-printing in Nokogiri while using to_html
?
I read that to_xml
allows this to be done using to_xml(:indent => 0)
, but this doesn't work with to_html
.
Right now I am using gsub
to strip away new-line characters. Does Nokogiri provide any option to do it?
HTML.fragment()
? See [this question][1]. [1]: #4723844 – Vital