Welcome to mirror list, hosted at ThFree Co, Russian Federation.

html5_converter_spec.rb « asciidoc « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de1b3e2af71119f25a13ec1b0aaf4c0de6c6513e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Asciidoc::Html5Converter do
  describe 'convert AsciiDoc to HTML5' do
    it 'appends user-content- prefix on ref (anchor)' do
      doc = Asciidoctor::Document.new('')
      anchor = Asciidoctor::Inline.new(doc, :anchor, '', type: :ref, id: 'cross-references')
      converter = Gitlab::Asciidoc::Html5Converter.new('gitlab_html5')
      html = converter.convert_inline_anchor(anchor)
      expect(html).to eq('<a id="user-content-cross-references"></a>')
    end
  end
end