I am using Nokogiri in a Rails 3 app. It ignores
<br/>
tags. I’d like to replace such tags with “, ” because they represent line breaks in addresses. How do I do this? I’ve tried the following, which doesn’t seem to help:
doc.inner_html.gsub!("<br/>", ", ")
Simply:
Seen in action:
If you want to be more careful and only replace the
<br>inside an<address>tag (for example), then: