lib/html-native.rb
# Checks if the attribute is valid for a given tag.
#
# For example, `class` and `hidden` are valid for everything, but `autoplay` 
# is valid for only `video` and `audio` tags, and invalid for all other tags.
Checks if the attribute is valid for a given tag.
Checks if the attribute is valid for a given tag .
def valid_attribute?(tag, attribute)
    if LIMITED_ATTRIBUTES.key?(attribute.to_sym)
      return LIMITED_ATTRIBUTES[attribute.to_sym].include?(tag.to_sym)
    end
    return !FORBIDDEN_ATTRIBUTES.include?(attribute)
  end
def valid_attribute? ( tag , attribute ) if LIMITED_ATTRIBUTES . key? ( attribute . to_sym ) return LIMITED_ATTRIBUTES [ attribute . to_sym ] . include? ( tag . to_sym ) end return ! FORBIDDEN_ATTRIBUTES . include? ( attribute ) end
Checks if the attribute is valid for a given tag.
Checks if the attribute is valid for a given tag .
tag
<not_specific>
attribute
<not_specific>