Skip to content

Commit

Permalink
Force re-validiton of nokogiri html doc aftere ignored tags removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Suscak committed Feb 23, 2015
1 parent 3dc290c commit 351f3ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/html/proofer/check_runner.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# encoding: utf-8

require_relative './utils'

module HTML
class Proofer
# Mostly handles issue management and collecting of external URLs.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 351f3ce

Please sign in to comment.