diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/lib/gitlab/asciidoc | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/lib/gitlab/asciidoc')
-rw-r--r-- | spec/lib/gitlab/asciidoc/html5_converter_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/asciidoc/html5_converter_spec.rb b/spec/lib/gitlab/asciidoc/html5_converter_spec.rb new file mode 100644 index 00000000000..84c2cda496e --- /dev/null +++ b/spec/lib/gitlab/asciidoc/html5_converter_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require '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 |