Convert html to plain text in ruby


I’m looking for a way to convert html to plain text.
Now, I know about strip_tags, but - as the name says - that only
strips the tags.

What I need is to get stuff like & and < back to & and < too.
Any help?


You could use some regexp and the hash ERB::Util::HTML_ESCAPE to
return the unescaped versions of the characters.

  • Richard

On Oct 1, 3:31 pm, “[email protected][email protected]