Overview of Loofah
mainLoofah is a Ruby library designed for manipulating and transforming HTML and XML documents and fragments. It is built on top of Nokogiri and serves two primary purposes:
- General Document Transformation: A framework for writing custom scrubbers to transform XML, XHTML, and HTML documents.
- HTML Sanitization: A toolkit providing built-in sanitization transformations based on
html5lib's safelist.
For Rails users, Loofah can be used to replace the standard strip_tags and sanitize view helper methods. Additionally, loofah-activerecord is available for Active Record extensions.