def parse_special_attributes(raw_attrs)
      return {} if raw_attrs.blank?
      items = raw_attrs.split(/\s+/)

      id      = items.select { |i| i =~ /^#.+/ }.first.gsub('#', '')
      classes = items.select { |i| i =~ /^\..+/ }.map { |c| c.gsub('.', '') }
      attrs   = Hash[items.select { |i| i.include?('=') }.map { |i| i.split('=') }]

      attrs.merge({
        'id' => id,
        'class' => classes.join(' ')
      })
    end
def parse_special_attributes(raw_attrs)
      return {} if raw_attrs.blank?
      items = raw_attrs.split(/\s+/)

      id      = items.select { |i| i =~ /^#.+/ }.first.gsub('#', '')
      classes = items.select { |i| i =~ /^\..+/ }.map { |c| c.gsub('.', '') }
      attrs   = Hash[items.select { |i| i.include?('=') }.map { |i| i.split('=') }]

      attrs.merge({
        'id' => id,
        'class' => classes.join(' ')
      })
    end
Parses additional attributes placed within brackets:

 ![](/foo.jpg){.regular #hero lang=fr}
 ![](/bar.jpg){.big #the-site data-behavior=lightbox}

 Note: works with images only.