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 =
[
  "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



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/better_html/test_helper/safe_erb/tag_interpolation.rb', line 23

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