# File lib/asciidoctor/attribute_list.rb, line 96
  def parse_attribute(index = 0, pos_attrs = [])
    single_quoted_value = false
    skip_blank
    first = @scanner.peek(1)
    # example: "quote" || 'quote'
    if @quotes.include? first
      value = nil
      name = parse_attribute_value @scanner.get_byte
      if first == '\''
        single_quoted_value = true
      end
    else
      name = scan_name

      skipped = 0
      c = nil
      if @scanner.eos?
        if name.nil?
          return false
        end
      else
        skipped = skip_blank || 0
        c = @scanner.get_byte
      end

      # example: quote
      if c.nil? || c == @delimiter
        value = nil
      # example: Sherlock Holmes || =foo=
      elsif c != '=' || name.nil?
        remainder = scan_to_delimiter
        name = '' if name.nil?
        name += ' ' * skipped + c
        name += remainder unless remainder.nil?
        value = nil
      else
        skip_blank
        # example: foo=,
        if @scanner.peek(1) == @delimiter
          value = nil
        else
          c = @scanner.get_byte

          # example: foo="bar" || foo='bar' || foo="ba\"zaar" || foo='ba\'zaar' || foo='ba"zaar' (all spaces ignored)
          if @quotes.include? c
            value = parse_attribute_value c
            if c == '\''
              single_quoted_value = true
            end
          # example: foo=bar (all spaces ignored)
          elsif !c.nil?
            value = c + scan_to_delimiter
          end
        end
      end
    end

    if value.nil?
      resolved_name = single_quoted_value && !@block.nil? ? @block.apply_normal_subs(name) : name
      if !(pos_name = pos_attrs[index]).nil?
        @attributes[pos_name] = resolved_name
      else
        #@attributes[index + 1] = resolved_name
      end
      # not sure if we want to always assign the positional key
      @attributes[index + 1] = resolved_name
      # not sure if I want this assignment or not
      #@attributes[resolved_name] = nil
    else
      resolved_value = value
      # example: options="opt1,opt2,opt3"
      # opts is an alias for options
      if name == 'options' || name == 'opts'
        name = 'options'
        resolved_value.split(',').each do |o|
          @attributes[o.strip + '-option'] = ''
        end
      elsif single_quoted_value && !@block.nil?
        resolved_value = @block.apply_normal_subs(value)
      end
      @attributes[name] = resolved_value
    end

    true
  end