lib/theme_check/html_visitor.rb in theme-check-0.9.0 vs lib/theme_check/html_visitor.rb in theme-check-0.9.1
- old
+ new
@@ -20,13 +20,15 @@
def parse(template)
Nokogiri::HTML5.fragment(template.source)
end
def visit(node)
+ call_checks(:on_element, node) if node.element?
call_checks(:"on_#{node.name}", node)
node.children.each { |child| visit(child) }
unless node.literal?
call_checks(:"after_#{node.name}", node)
+ call_checks(:after_element, node) if node.element?
end
end
def call_checks(method, *args)
checks.call(method, *args)