flavorjones / loofah

Ruby library for HTML/XML transformation and sanitization
MIT License
934 stars 137 forks source link

add html5 support, get jruby green #261

Closed flavorjones closed 1 year ago

flavorjones commented 1 year ago

The libgumbo parser used by Nokogiri::HTML5 is superior, standards-wise, to the libxml2 parser used by Nokogiri::HTML4 (the default).

This PR replaces #239. It has a much more flexible API that provides both html4 and html5 methods. It's up to the caller to choose which they want (note that the generic calls like Loofah.fragment still default to HTML4).

Note that testing in CI with older Rubies is sufficient to test older versions of Nokogiri, because Ruby 2.5 and 2.6 use Nokogiri 1.12 and 1.13, respectively, for precompiled binaries.