# File lib/asciidoctor/parser.rb, line 1169
  def self.catalog_inline_anchors text, block, document
    text.scan(InlineAnchorScanRx) do
      if (id = $1)
        if (reftext = $2)
          next if (reftext.include? ATTR_REF_HEAD) && (reftext = document.sub_attributes reftext).empty?
        end
      else
        id = $3
        if (reftext = $4)
          reftext = reftext.gsub '\]', ']' if reftext.include? ']'
          next if (reftext.include? ATTR_REF_HEAD) && (reftext = document.sub_attributes reftext).empty?
        end
      end
      unless document.register :refs, [id, (Inline.new block, :anchor, reftext, :type => :ref, :id => id), reftext]
        warn %(asciidoctor: WARNING: #{document.reader.path}: id assigned to anchor already in use: #{id})
      end
    end if (text.include? '[[') || (text.include? 'or:')
    nil
  end