By default, assertions use Nokogiri's HTML4 parser. You can change the default parser version globally or per assertion.
Global Configuration
In a standalone environment, set:
Rails::Dom::Testing.default_html_version = :html5
In a Rails application, set the configuration in your application config:
Rails.application.config.dom_testing_default_html_version = :html5
Note: If the HTML5 parser is not available on your platform, setting this will raise a NotImplementedError.
Per-assertion Override
You can override the default version for a single call using the html_version: keyword argument:
assert_dom_equal(expected, actual, html_version: :html5)
# Example of per-assertion override
assert_dom_not_equal(expected, actual, html_version: :html4)