Checkout the Ruby CGI class. There are methods to encode and decode HTML as well as URLs.
CGI::escapeHTML('Usage: foo "bar" <baz>')
# => "Usage: foo "bar" <baz>"
More Related Contents:
- Ruby on Rails: how to render a string as HTML?
- How do I properly escape quotes inside HTML attributes?
- How to avoid joining all text from Nodes when scraping
- How do I escape ampersands in XML so they are rendered as entities in HTML?
- Component to inject and interpret String with HTML code into JSF page
- How do I encode/decode HTML entities in Ruby?
- printing “” using html
- How can I escape a single quote?
- Why shouldn’t `'` be used to escape single quotes?
- How to escape < and > inside tags
- How to escape double quotes in a title attribute
- Form is submitted when I click on the button in form. How to avoid this?
- Safari 9.0 can not play mp4 video on the storage server
- How do I set the HTML options for collection_select in Rails?
- How do I pretty-print HTML with Nokogiri?
- Why is the first element always blank in my Rails multi-select, using an embedded array?
- How to have quotation marks in HTML input values [duplicate]
- How do I parse an HTML table with Nokogiri?
- What does #/ means in url?
- How do I add HTML code to JSF FacesMessage
- Adding icon to rails application
- How to get the HTML source of a webpage in Ruby [duplicate]
- Is it possible to update non-JSF components (plain HTML) with JSF ajax?
- Unskewing the ends of an assortment multiple skewed images
- How to align two elements on the same line without changing HTML
- Remove border from buttons
- CSS Selector “(A or B) and C”?
- How to change one element while hovering over another with CSS
- IE7 CSS Scrolling Div Bug
- Image placeholder fallback for HTML5 Video