def parse_quoted_text_attributes(str)
return unless str
return {} if str.empty?
str = sub_attributes(str) if str.include?('{')
str = str.strip
str, _ = str.split(',', 2) if str.include?(',')
if str.empty?
{}
elsif (str.start_with?('.') || str.start_with?('#')) && Compliance.shorthand_property_syntax
segments = str.split('#', 2)
if segments.length > 1
id, *more_roles = segments[1].split('.')
else
id = nil
more_roles = []
end
roles = segments[0].empty? ? [] : segments[0].split('.')
if roles.length > 1
roles.shift
end
if more_roles.length > 0
roles.concat more_roles
end
attrs = {}
attrs['id'] = id if id
attrs['role'] = roles * ' ' unless roles.empty?
attrs
else
{'role' => str}
end
end