summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/asciidoc_spec.rb
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-05-09 14:14:24 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-05-24 15:47:35 +0200
commit3ca932844316f567f9ed091d7185ad9fafc27c51 (patch)
treeccb51fd4994c624fa3118ba60644ba7f410e7e6e /spec/lib/gitlab/asciidoc_spec.rb
parent0b946a7bc69058a952a558a9530cd3e8302361e7 (diff)
downloadgitlab-ce-3ca932844316f567f9ed091d7185ad9fafc27c51.tar.gz
Fix LaTeX formatting for AsciiDoc wiki
Diffstat (limited to 'spec/lib/gitlab/asciidoc_spec.rb')
-rw-r--r--spec/lib/gitlab/asciidoc_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb
index 2c7ebb15fd7..43d52b941ab 100644
--- a/spec/lib/gitlab/asciidoc_spec.rb
+++ b/spec/lib/gitlab/asciidoc_spec.rb
@@ -70,6 +70,31 @@ module Gitlab
expect(output).to include('rel="nofollow noreferrer noopener"')
end
end
+
+ context 'LaTex code' do
+ it 'adds class js-render-math to the output' do
+ input = <<~MD
+ :stem: latexmath
+
+ [stem]
+ ++++
+ \sqrt{4} = 2
+ ++++
+
+ another part
+
+ [latexmath]
+ ++++
+ \beta_x \gamma
+ ++++
+
+ stem:[2+2] is 4
+ MD
+
+ expect(render(input, context)).to include('<pre data-math-style="display" class="code math js-render-math"><code>eta_x gamma</code></pre>')
+ expect(render(input, context)).to include('<p><code data-math-style="inline" class="code math js-render-math">2+2</code> is 4</p>')
+ end
+ end
end
def render(*args)