:unprintable removes unprintable Unicode characters.
markup = "<p>Some text with an unprintable character at the end\u2028</p>" Loofah.fragment(markup).scrub!(:unprintable) => "<p>Some text with an unprintable character at the end</p>"
You may not be able to see the unprintable character in the above example, but there is a U+2028 character right before the closing </p> tag. These characters can cause issues if the content is ever parsed by JavaScript - more information here:
http://timelessrepo.com/json-isnt-a-javascript-subset
Generated with the Darkfish Rdoc Generator 2.