blob: 88e554ebf0a7509eb93dc3823ba74881f60cadef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
require_relative 'spec_helper'
describe 'Asciidoctor::Epub3::Converter - Stem' do
it 'supports mathml stem blocks' do
book, = to_epub fixture_file('stem.adoc')
chapter = book.item_by_href '_article.xhtml'
expect(chapter).not_to be_nil
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 'supports inline mathml' do
book, = to_epub fixture_file('inline-stem.adoc')
chapter = book.item_by_href '_article.xhtml'
expect(chapter).not_to be_nil
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
|