summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/asciidoc/html5_converter_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/asciidoc/html5_converter_spec.rb')
-rw-r--r--spec/lib/gitlab/asciidoc/html5_converter_spec.rb15
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