Class: BetterHtml::TestHelper::SafeErb::TagInterpolation

Inherits:
Base
  • Object
show all
Defined in:
lib/better_html/test_helper/safe_erb/tag_interpolation.rb

Constant Summary collapse

NO_HTML_TAGS =
%w(
  title textarea script
  style xmp iframe noembed noframes listing plaintext
)

Instance Attribute Summary

Attributes inherited from Base

#errors

Instance Method Summary collapse

Methods inherited from Base

#add_error, #initialize

Constructor Details

This class inherits a constructor from BetterHtml::TestHelper::SafeErb::Base

Instance Method Details

#validateObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/better_html/test_helper/safe_erb/tag_interpolation.rb', line 14

def validate
  @parser.nodes_with_type(:tag).each do |tag_node|
    tag = Tree::Tag.from_node(tag_node)
    tag.attributes.each do |attribute|
      validate_attribute(attribute)
    end
  end

  @parser.nodes_with_type(:text).each do |node|
    validate_text_node(node) unless no_html_tag?(node)
  end
end