module Kramdown::Parser::Html::Parser
def parse_html_attributes(str, line = nil, in_html_tag = true)
If the optional +in_html_tag+ parameter is set to +false+, attributes are not modified to
If the optional +line+ parameter is supplied, it is used in warning messages.
Parses the given string for HTML attributes and returns the resulting hash.
def parse_html_attributes(str, line = nil, in_html_tag = true) attrs = {} str.scan(HTML_ATTRIBUTE_RE).each do |attr, val, _sep, quoted_val| attr.downcase! if in_html_tag if attrs.key?(attr) warning("Duplicate HTML attribute '#{attr}' on line #{line || '?'} - overwriting previous one") end attrs[attr] = val || quoted_val || "" end attrs end