summaryrefslogtreecommitdiff
path: root/spec/stem_spec.rb
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2020-07-03 18:38:38 +0300
committerGitHub <noreply@github.com>2020-07-03 18:38:38 +0300
commitdd39e5e34c455262f568424084b199142973127c (patch)
tree2e1e4f2203a08b04a5dcbfb800c5dd9a3fe55be7 /spec/stem_spec.rb
parent79ea7e7d8b1ca01b0d93fe307b0b1fd2b5aa22f0 (diff)
resolves #10 add support for MathML via AsciiMath (#346)
Diffstat (limited to 'spec/stem_spec.rb')
-rw-r--r--spec/stem_spec.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/stem_spec.rb b/spec/stem_spec.rb
index 33d2637..a5e3348 100644
--- a/spec/stem_spec.rb
+++ b/spec/stem_spec.rb
@@ -3,17 +3,21 @@
require_relative 'spec_helper'
describe 'Asciidoctor::Epub3::Converter - Stem' do
- it 'converts stem block to <pre>' do
- book, = to_epub fixture_file('stem/book.adoc')
- chapter = book.item_by_href '_chapter.xhtml'
+ it 'supports mathml stem blocks' do
+ book, = to_epub fixture_file('stem.adoc')
+ chapter = book.item_by_href 'stem.xhtml'
expect(chapter).not_to be_nil
- expect(chapter.content).to include '<pre>\sqrt(4) = 2</pre>'
+ expect(chapter.content).to include '<figcaption>Math</figcaption>
+<div class="content">
+<mml:math><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:msqrt><mml:mn>4</mml:mn></mml:msqrt></mml:math>
+</div>
+</figure>'
end
- it 'converts inline stem to <code>' do
- book, = to_epub fixture_file('inline-stem/book.adoc')
- chapter = book.item_by_href '_chapter.xhtml'
+ it 'supports inline mathml' do
+ book, = to_epub fixture_file('inline-stem.adoc')
+ chapter = book.item_by_href 'inline-stem.xhtml'
expect(chapter).not_to be_nil
- expect(chapter.content).to include '<code class="literal">y=x^2 sqrt(4)</code>'
+ expect(chapter.content).to include 'Inline stem: <code class="literal"><mml:math><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:msqrt><mml:mn>4</mml:mn></mml:msqrt></mml:math></code>'
end
end