class Markaby::HTML5

Constants

AttrsHTML5

Public Class Methods

can_handle?(tag_name) click to toggle source
# File lib/markaby/html5.rb, line 17
def can_handle? tag_name
  custom_element? tag_name
end
custom_element?(tag_name) click to toggle source
# File lib/markaby/html5.rb, line 13
def custom_element? tag_name
  tag_name.to_s.include? "_"
end
custom_element_tag_for(tag_name) click to toggle source
# File lib/markaby/html5.rb, line 29
def custom_element_tag_for tag_name
  tag_name.to_s.tr("_", "-").to_sym
end
default_options() click to toggle source
Calls superclass method
# File lib/markaby/html5.rb, line 5
def default_options
  super.merge({
    output_xml_instruction: false,
    output_meta_tag: "html5",
    root_attributes: {}
  })
end
handle_tag(tag_name, builder, *args, &block) click to toggle source
# File lib/markaby/html5.rb, line 21
def handle_tag tag_name, builder, *args, &block
  builder.tag! tag_name, *args, &block
end
validate_and_transform_tag_name!(tag_name) click to toggle source
Calls superclass method
# File lib/markaby/html5.rb, line 25
def validate_and_transform_tag_name! tag_name
  custom_element?(tag_name) ? custom_element_tag_for(tag_name) : super
end
validate_attribute!(tag_name, attribute_name) click to toggle source
Calls superclass method
# File lib/markaby/html5.rb, line 33
def validate_attribute! tag_name, attribute_name
  custom_element?(tag_name) || super
end