# File lib/asciidoctor/converter/html5.rb, line 1011
    def inline_anchor node
      target = node.target
      case node.type
      when :xref
        refid = node.attributes['refid'] || target
        # NOTE we lookup text in converter because DocBook doesn't need this logic
        text = node.text || (node.document.references[:ids][refid] || %([#{refid}]))
        # FIXME shouldn't target be refid? logic seems confused here
        %(<a href="#{target}">#{text}</a>)
      when :ref
        %(<a id="#{target}"></a>)
      when :link
        attrs = []
        attrs << %( id="#{node.id}") if node.id
        if (role = node.role)
          attrs << %( class="#{role}")
        end
        attrs << %( title="#{node.attr 'title'}") if node.attr? 'title', nil, false
        attrs << %( target="#{node.attr 'window'}") if node.attr? 'window', nil, false
        %(<a href="#{target}"#{attrs.join}>#{node.text}</a>)
      when :bibref
        %(<a id="#{target}"></a>[#{target}])
      else
        warn %(asciidoctor: WARNING: unknown anchor type: #{node.type.inspect})
      end
    end