debian-mirror-gitlab/spec/lib/gitlab/asciidoc/html5_converter_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
557 B
Ruby
Raw Permalink Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
2022-10-11 01:57:18 +05:30
require 'fast_spec_helper'
2021-02-22 17:27:13 +05:30
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