class Phlex::HTML
def __build_attributes__(attributes, buffer:)
def __build_attributes__(attributes, buffer:) tes.each do |k, v| nless v case k String then k Symbol then k.name.tr("_", "-") k.to_s name = name.downcase f lower_name == "href" && v.start_with?(/\s*javascript:/i) ct unsafe attribute names. Attribute names are considered unsafe if they match an event attribute or include unsafe characters. L::EVENT_ATTRIBUTES[lower_name] || name.match?(/[<>&"']/) ArgumentError, "Unsafe attribute name detected: #{k}." rue r << " " << name tring r << " " << name << '="' << ERB::Util.html_escape(v) << '"' ymbol r << " " << name << '="' << ERB::Util.html_escape(v.name) << '"' ash ld_attributes__( ansform_keys { |subkey| e subkey en Symbol then"#{k}-#{subkey.name.tr('_', '-')}" se "#{k}-#{subkey}" uffer: buffer r << " " << name << '="' << ERB::Util.html_escape(v.to_s) << '"'