diff --git a/lib/html/proofer/check_runner.rb b/lib/html/proofer/check_runner.rb index c13bb8b3..036aed86 100644 --- a/lib/html/proofer/check_runner.rb +++ b/lib/html/proofer/check_runner.rb @@ -1,5 +1,7 @@ # encoding: utf-8 +require_relative './utils' + module HTML class Proofer # Mostly handles issue management and collecting of external URLs. @@ -53,7 +55,11 @@ def self.checks def remove_ignored(html) html.css('code, pre, svg').each(&:unlink) - html + # We have to create a new document here otherwise we would still + # see errors because they get generated immediately after document + # is loaded so we have to re-validate the document after removing + # ignored tags. + HTML::Utils.create_nokogiri(html.to_s) end end end