asciimath 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.adoc +14 -1
- data/lib/asciimath/html.rb +2 -2
- data/lib/asciimath/mathml.rb +14 -15
- data/lib/asciimath/parser.rb +31 -5
- data/lib/asciimath/version.rb +1 -1
- data/spec/parser_spec.rb +45 -35
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a3e9e8a863b42ffb8788f83dfe52a7b0f7aeda15
|
4
|
+
data.tar.gz: 7bdfb353b3174675557ee1e34fb7c1540cc228d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6519e15f4b8961ef8a249675cbef420407b188231e49b0df9102587bec3b0aca2c4aaccd692d627354f5a426149a370aa52e52dade9cf73ee59934a0c6e05f8f
|
7
|
+
data.tar.gz: 5abc03d0ae7d9dd9f846c2e8a450e0b76011687bf6ecaf39ad33c2fa594cbfa251d02a45a53ab9a8f7d4f5f74dce937eed3a0d192a43e244f7a6dabc87404bf5
|
data/CHANGELOG.adoc
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
= Asciimath Changelog
|
2
2
|
|
3
|
-
== 1.0.
|
3
|
+
== 1.0.9
|
4
|
+
|
5
|
+
Bug fixes::
|
6
|
+
|
7
|
+
* Issue #13: Improve matrix parsing
|
8
|
+
* Output `mfenced` tags instead of `mo` pairs to improve MathML compatbility with Microsoft Office (@opoudjis)
|
9
|
+
|
10
|
+
== 1.0.8
|
11
|
+
|
12
|
+
Bug fixes::
|
13
|
+
|
14
|
+
* Issue #9 and #10: Resolve compatibility issues with TruffleRuby
|
15
|
+
|
16
|
+
== 1.0.7
|
4
17
|
|
5
18
|
Bug fixes::
|
6
19
|
|
data/lib/asciimath/html.rb
CHANGED
@@ -23,7 +23,7 @@ module AsciiMath
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
-
ZWJ = "\
|
26
|
+
ZWJ = "\u200D"
|
27
27
|
|
28
28
|
def append(expression, opts = {})
|
29
29
|
case expression
|
@@ -231,4 +231,4 @@ module AsciiMath
|
|
231
231
|
HTMLBuilder.new(prefix).append_expression(@parsed_expression, inline, attrs).to_s
|
232
232
|
end
|
233
233
|
end
|
234
|
-
end
|
234
|
+
end
|
data/lib/asciimath/mathml.rb
CHANGED
@@ -38,18 +38,9 @@ module AsciiMath
|
|
38
38
|
when :text
|
39
39
|
mtext(expression[:c])
|
40
40
|
when :paren
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
mo(expression[:lparen]) if expression[:lparen]
|
45
|
-
append(expression[:e], :single_child => true)
|
46
|
-
mo(expression[:rparen]) if expression[:rparen]
|
47
|
-
else
|
48
|
-
mrow do
|
49
|
-
mo(expression[:lparen]) if expression[:lparen]
|
50
|
-
append(expression[:e], :single_child => true)
|
51
|
-
mo(expression[:rparen]) if expression[:rparen]
|
52
|
-
end
|
41
|
+
if !opts[:strip_paren]
|
42
|
+
fenced(expression[:lparen], expression[:rparen]) do
|
43
|
+
append(expression[:e])
|
53
44
|
end
|
54
45
|
else
|
55
46
|
append(expression[:e])
|
@@ -78,8 +69,7 @@ module AsciiMath
|
|
78
69
|
append(expression[:s3], :strip_paren => true)
|
79
70
|
end
|
80
71
|
when :matrix
|
81
|
-
|
82
|
-
mo(expression[:lparen]) if expression[:lparen]
|
72
|
+
fenced(expression[:lparen], expression[:rparen]) do
|
83
73
|
mtable do
|
84
74
|
expression[:rows].each do |row|
|
85
75
|
mtr do
|
@@ -91,7 +81,6 @@ module AsciiMath
|
|
91
81
|
end
|
92
82
|
end
|
93
83
|
end
|
94
|
-
mo(expression[:rparen]) if expression[:rparen]
|
95
84
|
end
|
96
85
|
end
|
97
86
|
end
|
@@ -101,6 +90,16 @@ module AsciiMath
|
|
101
90
|
tag(meth, *args, &block)
|
102
91
|
end
|
103
92
|
|
93
|
+
def fenced(lparen, rparen, &block)
|
94
|
+
if lparen || rparen
|
95
|
+
mfenced(:open => lparen || '', :close => rparen || '') do
|
96
|
+
yield self
|
97
|
+
end
|
98
|
+
else
|
99
|
+
yield self
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
104
103
|
def tag(tag, *args)
|
105
104
|
attrs = args.last.is_a?(Hash) ? args.pop : {}
|
106
105
|
text = args.last.is_a?(String) ? args.pop : ''
|
data/lib/asciimath/parser.rb
CHANGED
@@ -541,15 +541,41 @@ module AsciiMath
|
|
541
541
|
end
|
542
542
|
|
543
543
|
def convert_to_matrix(expression)
|
544
|
-
return expression unless
|
544
|
+
return expression unless expression.is_a?(Hash) && expression[:type] == :paren
|
545
545
|
|
546
|
-
rows = expression[:e].
|
547
|
-
|
546
|
+
rows, separators = expression[:e].partition.with_index { |obj, i| i.even? }
|
547
|
+
return expression unless rows.length > 1 &&
|
548
|
+
rows.length > separators.length &&
|
549
|
+
separators.all? { |item| is_matrix_separator(item) } &&
|
550
|
+
(rows.all? { |item| item[:type] == :paren && item[:lparen] == '(' && item[:rparen] == ')' } ||
|
551
|
+
rows.all? { |item| item[:type] == :paren && item[:lparen] == '[' && item[:rparen] == ']' })
|
552
|
+
|
553
|
+
rows = rows.map do |row|
|
554
|
+
chunks = []
|
555
|
+
current_chunk = []
|
556
|
+
row[:e].each do |item|
|
557
|
+
if is_matrix_separator(item)
|
558
|
+
chunks << current_chunk
|
559
|
+
current_chunk = []
|
560
|
+
else
|
561
|
+
current_chunk << item
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
chunks << current_chunk
|
566
|
+
|
567
|
+
chunks.map {|c| c.length == 1 ? c[0] : c }.to_a
|
548
568
|
end
|
549
569
|
|
570
|
+
return expression unless rows.all? { |row| row.length == rows[0].length }
|
571
|
+
|
550
572
|
{:type => :matrix, :rows => rows, :lparen => expression[:lparen], :rparen => expression[:rparen]}
|
551
573
|
end
|
552
574
|
|
575
|
+
def is_matrix_separator(item)
|
576
|
+
item[:type] == :identifier && item[:c] == ','
|
577
|
+
end
|
578
|
+
|
553
579
|
def matrix?(expression)
|
554
580
|
return false unless expression.is_a?(Hash) && expression[:type] == :paren
|
555
581
|
|
@@ -557,7 +583,7 @@ module AsciiMath
|
|
557
583
|
|
558
584
|
rows.length > 1 &&
|
559
585
|
rows.length > separators.length &&
|
560
|
-
separators.all?
|
586
|
+
separators.all?(&method(:is_matrix_separator)) &&
|
561
587
|
(rows.all? { |item| item[:type] == :paren && item[:lparen] == '(' && item[:rparen] == ')' } ||
|
562
588
|
rows.all? { |item| item[:type] == :paren && item[:lparen] == '[' && item[:rparen] == ']' }) &&
|
563
589
|
rows.all? { |item| item[:e].length == rows[0][:e].length } &&
|
@@ -570,7 +596,7 @@ module AsciiMath
|
|
570
596
|
cols, separators = expression.partition.with_index { |obj, i| i.even? }
|
571
597
|
|
572
598
|
cols.all? { |item| item[:type] != :identifier || item[:c] != ',' } &&
|
573
|
-
separators.all?
|
599
|
+
separators.all?(&method(:is_col_separator))
|
574
600
|
end
|
575
601
|
end
|
576
602
|
|
data/lib/asciimath/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -11,7 +11,7 @@ TEST_CASES = {
|
|
11
11
|
'a^2 + b^2 = c^2' =>
|
12
12
|
{
|
13
13
|
:mathml => '<math><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></math>',
|
14
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">&#
|
14
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">‍</span></span><span class="math-operator">+</span><span class="math-identifier">b</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">‍</span></span><span class="math-operator">=</span><span class="math-identifier">c</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">‍</span></span></span></span>',
|
15
15
|
},
|
16
16
|
'x = (-b+-sqrt(b^2-4ac))/(2a)' =>
|
17
17
|
{
|
@@ -21,47 +21,47 @@ TEST_CASES = {
|
|
21
21
|
'm = (y_2 - y_1)/(x_2 - x_1) = (Deltay)/(Deltax)' =>
|
22
22
|
{
|
23
23
|
:mathml => '<math><mi>m</mi><mo>=</mo><mfrac><mrow><msub><mi>y</mi><mn>2</mn></msub><mo>−</mo><msub><mi>y</mi><mn>1</mn></msub></mrow><mrow><msub><mi>x</mi><mn>2</mn></msub><mo>−</mo><msub><mi>x</mi><mn>1</mn></msub></mrow></mfrac><mo>=</mo><mfrac><mrow><mo>Δ</mo><mi>y</mi></mrow><mrow><mo>Δ</mo><mi>x</mi></mrow></mfrac></math>',
|
24
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">m</span><span class="math-operator">=</span><span class="math-blank">&#
|
24
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">m</span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">y</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-number">2</span></span></span><span class="math-operator">−</span><span class="math-identifier">y</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-number">1</span></span></span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-number">2</span></span></span><span class="math-operator">−</span><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-number">1</span></span></span></span></span></span></span></span></span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-operator">Δ</span><span class="math-identifier">y</span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-operator">Δ</span><span class="math-identifier">x</span></span></span></span></span></span></span></span></span>'
|
25
25
|
},
|
26
26
|
'f\'(x) = lim_(Deltax->0)(f(x+Deltax)-f(x))/(Deltax)' =>
|
27
27
|
{
|
28
|
-
:mathml => '<math><mi>f</mi><mi>\'</mi><
|
29
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">f</span><span class="math-identifier">\'</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-operator">=</span><span class="math-blank">&#
|
28
|
+
:mathml => '<math><mi>f</mi><mi>\'</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mo>=</mo><munder><mo>lim</mo><mrow><mo>Δ</mo><mi>x</mi><mo>→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>f</mi><mfenced open="(" close=")"><mrow><mi>x</mi><mo>+</mo><mo>Δ</mo><mi>x</mi></mrow></mfenced><mo>−</mo><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced></mrow><mrow><mo>Δ</mo><mi>x</mi></mrow></mfrac></math>',
|
29
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">f</span><span class="math-identifier">\'</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-blank">‍</span></span><span class="math-operator">lim</span><span class="math-smaller"><span class="math-row"><span class="math-operator">Δ</span><span class="math-identifier">x</span><span class="math-operator">→</span><span class="math-number">0</span></span></span></span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span><span class="math-operator">+</span><span class="math-operator">Δ</span><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-operator">−</span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-operator">Δ</span><span class="math-identifier">x</span></span></span></span></span></span></span></span></span>'
|
30
30
|
},
|
31
31
|
'd/dx [x^n] = nx^(n - 1)' =>
|
32
32
|
{
|
33
|
-
:mathml => '<math><mfrac><mi>d</mi><mi>dx</mi></mfrac><
|
34
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
33
|
+
:mathml => '<math><mfrac><mi>d</mi><mi>dx</mi></mfrac><mfenced open="[" close="]"><msup><mi>x</mi><mi>n</mi></msup></mfenced><mo>=</mo><mi>n</mi><msup><mi>x</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msup></math>',
|
34
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-identifier">d</span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-identifier">dx</span></span></span></span></span></span><span class="math-row"><span class="math-brace">[</span><span class="math-row"><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">n</span></span><span class="math-smaller">‍</span></span></span><span class="math-brace">]</span></span><span class="math-operator">=</span><span class="math-identifier">n</span><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller"><span class="math-row"><span class="math-identifier">n</span><span class="math-operator">−</span><span class="math-number">1</span></span></span><span class="math-smaller">‍</span></span></span></span>'
|
35
35
|
},
|
36
36
|
'int_a^b f(x) dx = [F(x)]_a^b = F(b) - F(a)' =>
|
37
37
|
{
|
38
|
-
:mathml => '<math><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><
|
38
|
+
:mathml => '<math><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mi>dx</mi><mo>=</mo><msubsup><mfenced open="[" close="]"><mrow><mi>F</mi><mfenced open="(" close=")"><mi>x</mi></mfenced></mrow></mfenced><mi>a</mi><mi>b</mi></msubsup><mo>=</mo><mi>F</mi><mfenced open="(" close=")"><mi>b</mi></mfenced><mo>−</mo><mi>F</mi><mfenced open="(" close=")"><mi>a</mi></mfenced></math>',
|
39
39
|
:html => '<span class="math-inline"><span class="math-row"><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">b</span></span><span class="math-smaller"><span class="math-identifier">a</span></span></span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-identifier">dx</span><span class="math-operator">=</span><span class="math-row"><span class="math-brace">[</span><span class="math-row"><span class="math-identifier">F</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span></span><span class="math-brace">]</span></span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">b</span></span><span class="math-smaller"><span class="math-identifier">a</span></span></span><span class="math-operator">=</span><span class="math-identifier">F</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">b</span></span><span class="math-brace">)</span></span><span class="math-operator">−</span><span class="math-identifier">F</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">a</span></span><span class="math-brace">)</span></span></span></span>'
|
40
40
|
},
|
41
41
|
'int_a^b f(x) dx = f(c)(b - a)' =>
|
42
42
|
{
|
43
|
-
:mathml => '<math><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><
|
43
|
+
:mathml => '<math><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mi>dx</mi><mo>=</mo><mi>f</mi><mfenced open="(" close=")"><mi>c</mi></mfenced><mfenced open="(" close=")"><mrow><mi>b</mi><mo>−</mo><mi>a</mi></mrow></mfenced></math>',
|
44
44
|
:html => '<span class="math-inline"><span class="math-row"><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">b</span></span><span class="math-smaller"><span class="math-identifier">a</span></span></span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-identifier">dx</span><span class="math-operator">=</span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">c</span></span><span class="math-brace">)</span></span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">b</span><span class="math-operator">−</span><span class="math-identifier">a</span></span><span class="math-brace">)</span></span></span></span>'
|
45
45
|
},
|
46
46
|
'ax^2 + bx + c = 0' =>
|
47
47
|
{
|
48
48
|
:mathml => '<math><mi>a</mi><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mi>b</mi><mi>x</mi><mo>+</mo><mi>c</mi><mo>=</mo><mn>0</mn></math>',
|
49
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">a</span><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">&#
|
49
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">a</span><span class="math-identifier">x</span><span class="math-subsup"><span class="math-smaller"><span class="math-number">2</span></span><span class="math-smaller">‍</span></span><span class="math-operator">+</span><span class="math-identifier">b</span><span class="math-identifier">x</span><span class="math-operator">+</span><span class="math-identifier">c</span><span class="math-operator">=</span><span class="math-number">0</span></span></span>'
|
50
50
|
},
|
51
51
|
'"average value"=1/(b-a) int_a^b f(x) dx' =>
|
52
52
|
{
|
53
|
-
:mathml => '<math><mtext>average value</mtext><mo>=</mo><mfrac><mn>1</mn><mrow><mi>b</mi><mo>−</mo><mi>a</mi></mrow></mfrac><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><
|
54
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-text">average value</span><span class="math-operator">=</span><span class="math-blank">&#
|
53
|
+
:mathml => '<math><mtext>average value</mtext><mo>=</mo><mfrac><mn>1</mn><mrow><mi>b</mi><mo>−</mo><mi>a</mi></mrow></mfrac><msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mi>dx</mi></math>',
|
54
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-text">average value</span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-number">1</span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">b</span><span class="math-operator">−</span><span class="math-identifier">a</span></span></span></span></span></span></span><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">b</span></span><span class="math-smaller"><span class="math-identifier">a</span></span></span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-identifier">dx</span></span></span>'
|
55
55
|
},
|
56
56
|
'd/dx[int_a^x f(t) dt] = f(x)' =>
|
57
57
|
{
|
58
|
-
:mathml => '<math><mfrac><mi>d</mi><mi>dx</mi></mfrac><mrow><
|
59
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
58
|
+
:mathml => '<math><mfrac><mi>d</mi><mi>dx</mi></mfrac><mfenced open="[" close="]"><mrow><msubsup><mo>∫</mo><mi>a</mi><mi>x</mi></msubsup><mi>f</mi><mfenced open="(" close=")"><mi>t</mi></mfenced><mi>dt</mi></mrow></mfenced><mo>=</mo><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced></math>',
|
59
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-identifier">d</span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-identifier">dx</span></span></span></span></span></span><span class="math-row"><span class="math-brace">[</span><span class="math-row"><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-identifier">x</span></span><span class="math-smaller"><span class="math-identifier">a</span></span></span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">t</span></span><span class="math-brace">)</span></span><span class="math-identifier">dt</span></span><span class="math-brace">]</span></span><span class="math-operator">=</span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span></span></span>'
|
60
60
|
},
|
61
61
|
'hat(ab) bar(xy) ul(A) vec(v)' =>
|
62
62
|
{
|
63
63
|
:mathml => '<math><mover><mrow><mi>a</mi><mi>b</mi></mrow><mo>^</mo></mover><mover><mrow><mi>x</mi><mi>y</mi></mrow><mo>¯</mo></mover><munder><mi>A</mi><mo>_</mo></munder><mover><mi>v</mi><mo>→</mo></mover></math>',
|
64
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
64
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-operator">^</span></span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">a</span><span class="math-identifier">b</span></span><span class="math-brace">)</span></span><span class="math-smaller"><span class="math-blank">‍</span></span></span><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-operator">¯</span></span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span><span class="math-identifier">y</span></span><span class="math-brace">)</span></span><span class="math-smaller"><span class="math-blank">‍</span></span></span><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-blank">‍</span></span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">A</span></span><span class="math-brace">)</span></span><span class="math-smaller"><span class="math-operator">_</span></span></span><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-operator">→</span></span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">v</span></span><span class="math-brace">)</span></span><span class="math-smaller"><span class="math-blank">‍</span></span></span></span></span>'
|
65
65
|
},
|
66
66
|
'z_12^34' =>
|
67
67
|
{
|
@@ -70,43 +70,43 @@ TEST_CASES = {
|
|
70
70
|
},
|
71
71
|
'lim_(x->c)(f(x)-f(c))/(x-c)' =>
|
72
72
|
{
|
73
|
-
:mathml => '<math><munder><mo>lim</mo><mrow><mi>x</mi><mo>→</mo><mi>c</mi></mrow></munder><mfrac><mrow><mi>f</mi><
|
74
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
73
|
+
:mathml => '<math><munder><mo>lim</mo><mrow><mi>x</mi><mo>→</mo><mi>c</mi></mrow></munder><mfrac><mrow><mi>f</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mo>−</mo><mi>f</mi><mfenced open="(" close=")"><mi>c</mi></mfenced></mrow><mrow><mi>x</mi><mo>−</mo><mi>c</mi></mrow></mfrac></math>',
|
74
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-blank">‍</span></span><span class="math-operator">lim</span><span class="math-smaller"><span class="math-row"><span class="math-identifier">x</span><span class="math-operator">→</span><span class="math-identifier">c</span></span></span></span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-operator">−</span><span class="math-identifier">f</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">c</span></span><span class="math-brace">)</span></span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">x</span><span class="math-operator">−</span><span class="math-identifier">c</span></span></span></span></span></span></span></span></span>'
|
75
75
|
},
|
76
76
|
'int_0^(pi/2) g(x) dx' =>
|
77
77
|
{
|
78
|
-
:mathml => '<math><msubsup><mo>∫</mo><mn>0</mn><mfrac><mi>π</mi><mn>2</mn></mfrac></msubsup><mi>g</mi><
|
79
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-row"><span class="math-blank">&#
|
78
|
+
:mathml => '<math><msubsup><mo>∫</mo><mn>0</mn><mfrac><mi>π</mi><mn>2</mn></mfrac></msubsup><mi>g</mi><mfenced open="(" close=")"><mi>x</mi></mfenced><mi>dx</mi></math>',
|
79
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-operator">∫</span><span class="math-subsup"><span class="math-smaller"><span class="math-row"><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-identifier">π</span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-number">2</span></span></span></span></span></span></span></span><span class="math-smaller"><span class="math-number">0</span></span></span><span class="math-identifier">g</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">x</span></span><span class="math-brace">)</span></span><span class="math-identifier">dx</span></span></span>'
|
80
80
|
},
|
81
81
|
'sum_(n=0)^oo a_n' =>
|
82
82
|
{
|
83
83
|
:mathml => '<math><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mo>∞</mo></munderover><msub><mi>a</mi><mi>n</mi></msub></math>',
|
84
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
84
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-operator">∞</span></span><span class="math-operator">∑</span><span class="math-smaller"><span class="math-row"><span class="math-identifier">n</span><span class="math-operator">=</span><span class="math-number">0</span></span></span></span><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-identifier">n</span></span></span></span></span>'
|
85
85
|
},
|
86
86
|
'((1,2,3),(4,5,6),(7,8,9))' =>
|
87
87
|
{
|
88
|
-
:mathml => '<math><
|
88
|
+
:mathml => '<math><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr><mtr><mtd><mn>4</mn></mtd><mtd><mn>5</mn></mtd><mtd><mn>6</mn></mtd></mtr><mtr><mtd><mn>7</mn></mtd><mtd><mn>8</mn></mtd><mtd><mn>9</mn></mtd></mtr></mtable></mfenced></math>',
|
89
89
|
:html => '<span class="math-inline"><span class="math-row"><span class="math-row"><span class="math-brace" style="font-size: 300%;">(</span><span class="math-matrix" style="grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);"><span class="math-row"><span class="math-number">1</span></span><span class="math-row"><span class="math-number">2</span></span><span class="math-row"><span class="math-number">3</span></span><span class="math-row"><span class="math-number">4</span></span><span class="math-row"><span class="math-number">5</span></span><span class="math-row"><span class="math-number">6</span></span><span class="math-row"><span class="math-number">7</span></span><span class="math-row"><span class="math-number">8</span></span><span class="math-row"><span class="math-number">9</span></span></span><span class="math-brace" style="font-size: 300%;">)</span></span></span></span>'
|
90
90
|
},
|
91
91
|
'|(a,b),(c,d)|=ad-bc' =>
|
92
92
|
{
|
93
|
-
:mathml => '<math><
|
93
|
+
:mathml => '<math><mfenced open="|" close="|"><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable></mfenced><mo>=</mo><mi>a</mi><mi>d</mi><mo>−</mo><mi>b</mi><mi>c</mi></math>',
|
94
94
|
:html => '<span class="math-inline"><span class="math-row"><span class="math-row"><span class="math-brace" style="font-size: 200%;">|</span><span class="math-matrix" style="grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);"><span class="math-row"><span class="math-identifier">a</span></span><span class="math-row"><span class="math-identifier">b</span></span><span class="math-row"><span class="math-identifier">c</span></span><span class="math-row"><span class="math-identifier">d</span></span></span><span class="math-brace" style="font-size: 200%;">|</span></span><span class="math-operator">=</span><span class="math-identifier">a</span><span class="math-identifier">d</span><span class="math-operator">−</span><span class="math-identifier">b</span><span class="math-identifier">c</span></span></span>'
|
95
95
|
},
|
96
96
|
'((a_(11), cdots , a_(1n)),(vdots, ddots, vdots),(a_(m1), cdots , a_(mn)))' =>
|
97
97
|
{
|
98
|
-
:mathml => '<math><
|
99
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-row"><span class="math-brace" style="font-size: 300%;">(</span><span class="math-matrix" style="grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);"><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">&#
|
98
|
+
:mathml => '<math><mfenced open="(" close=")"><mtable><mtr><mtd><msub><mi>a</mi><mn>11</mn></msub></mtd><mtd><mo>⋯</mo></mtd><mtd><msub><mi>a</mi><mrow><mn>1</mn><mi>n</mi></mrow></msub></mtd></mtr><mtr><mtd><mo>⋮</mo></mtd><mtd><mo>⋱</mo></mtd><mtd><mo>⋮</mo></mtd></mtr><mtr><mtd><msub><mi>a</mi><mrow><mi>m</mi><mn>1</mn></mrow></msub></mtd><mtd><mo>⋯</mo></mtd><mtd><msub><mi>a</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mtd></mtr></mtable></mfenced></math>',
|
99
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-row"><span class="math-brace" style="font-size: 300%;">(</span><span class="math-matrix" style="grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);"><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-row"><span class="math-number">11</span></span></span></span></span><span class="math-row"><span class="math-operator">⋯</span></span><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-row"><span class="math-number">1</span><span class="math-identifier">n</span></span></span></span></span><span class="math-row"><span class="math-operator">⋮</span></span><span class="math-row"><span class="math-operator">⋱</span></span><span class="math-row"><span class="math-operator">⋮</span></span><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-row"><span class="math-identifier">m</span><span class="math-number">1</span></span></span></span></span><span class="math-row"><span class="math-operator">⋯</span></span><span class="math-row"><span class="math-identifier">a</span><span class="math-subsup"><span class="math-smaller">‍</span><span class="math-smaller"><span class="math-row"><span class="math-identifier">m</span><span class="math-identifier">n</span></span></span></span></span></span><span class="math-brace" style="font-size: 300%;">)</span></span></span></span>'
|
100
100
|
},
|
101
101
|
'sum_(k=1)^n k = 1+2+ cdots +n=(n(n+1))/2' =>
|
102
102
|
{
|
103
|
-
:mathml => '<math><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mi>k</mi><mo>=</mo><mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mo>⋯</mo><mo>+</mo><mi>n</mi><mo>=</mo><mfrac><mrow><mi>n</mi><mrow><
|
104
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">&#
|
103
|
+
:mathml => '<math><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mi>k</mi><mo>=</mo><mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mo>⋯</mo><mo>+</mo><mi>n</mi><mo>=</mo><mfrac><mrow><mi>n</mi><mfenced open="(" close=")"><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfenced></mrow><mn>2</mn></mfrac></math>',
|
104
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-blank">‍</span><span class="math-underover"><span class="math-smaller"><span class="math-identifier">n</span></span><span class="math-operator">∑</span><span class="math-smaller"><span class="math-row"><span class="math-identifier">k</span><span class="math-operator">=</span><span class="math-number">1</span></span></span></span><span class="math-identifier">k</span><span class="math-operator">=</span><span class="math-number">1</span><span class="math-operator">+</span><span class="math-number">2</span><span class="math-operator">+</span><span class="math-operator">⋯</span><span class="math-operator">+</span><span class="math-identifier">n</span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">n</span><span class="math-row"><span class="math-brace">(</span><span class="math-row"><span class="math-identifier">n</span><span class="math-operator">+</span><span class="math-number">1</span></span><span class="math-brace">)</span></span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-number">2</span></span></span></span></span></span></span></span>'
|
105
105
|
},
|
106
106
|
'"Скорость"=("Расстояние")/("Время")' =>
|
107
107
|
{
|
108
108
|
:mathml => '<math><mtext>Скорость</mtext><mo>=</mo><mfrac><mtext>Расстояние</mtext><mtext>Время</mtext></mfrac></math>',
|
109
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-text">Скорость</span><span class="math-operator">=</span><span class="math-blank">&#
|
109
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-text">Скорость</span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-text">Расстояние</span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-text">Время</span></span></span></span></span></span></span></span></span>'
|
110
110
|
},
|
111
111
|
'bb (a + b) + cc c = fr (d^n)' =>
|
112
112
|
{
|
@@ -115,7 +115,7 @@ TEST_CASES = {
|
|
115
115
|
},
|
116
116
|
'max()' =>
|
117
117
|
{
|
118
|
-
:mathml => '<math><mi>max</mi><
|
118
|
+
:mathml => '<math><mi>max</mi><mfenced open="(" close=")"></mfenced></math>',
|
119
119
|
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">max</span><span class="math-row"><span class="math-brace">(</span><span class="math-brace">)</span></span></span></span>'
|
120
120
|
},
|
121
121
|
'text("foo")' => {
|
@@ -124,7 +124,16 @@ TEST_CASES = {
|
|
124
124
|
},
|
125
125
|
'ubrace(1 + 2) obrace(3 + 4' => {
|
126
126
|
:mathml => '<math><munder><mrow><mn>1</mn><mo>+</mo><mn>2</mn></mrow><mo>⏟</mo></munder><mover><mrow><mn>3</mn><mo>+</mo><mn>4</mn></mrow><mo>⏞</mo></mover></math>'
|
127
|
-
}
|
127
|
+
},
|
128
|
+
"s'_i = {(- 1, if s_i > s_(i + 1)),( + 1, if s_i <= s_(i + 1)):}" => {
|
129
|
+
:mathml => '<math><mi>s</mi><msub><mi>\'</mi><mi>i</mi></msub><mo>=</mo><mfenced open="{" close=""><mtable><mtr><mtd><mrow><mo>−</mo><mn>1</mn></mrow></mtd><mtd><mrow><mo>if</mo><msub><mi>s</mi><mi>i</mi></msub><mo>></mo><msub><mi>s</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow></mtd></mtr><mtr><mtd><mrow><mo>+</mo><mn>1</mn></mrow></mtd><mtd><mrow><mo>if</mo><msub><mi>s</mi><mi>i</mi></msub><mo>≤</mo><msub><mi>s</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow></mtd></mtr></mtable></mfenced></math>'
|
130
|
+
},
|
131
|
+
"s'_i = {(, if s_i > s_(i + 1)),( + 1,):}" => {
|
132
|
+
:mathml => '<math><mi>s</mi><msub><mi>\'</mi><mi>i</mi></msub><mo>=</mo><mfenced open="{" close=""><mtable><mtr><mtd></mtd><mtd><mrow><mo>if</mo><msub><mi>s</mi><mi>i</mi></msub><mo>></mo><msub><mi>s</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow></mtd></mtr><mtr><mtd><mrow><mo>+</mo><mn>1</mn></mrow></mtd><mtd></mtd></mtr></mtable></mfenced></math>'
|
133
|
+
},
|
134
|
+
'{:(a,b),(c,d):}' => {
|
135
|
+
:mathml => '<math><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable></math>'
|
136
|
+
},
|
128
137
|
}
|
129
138
|
|
130
139
|
version = RUBY_VERSION.split('.').map { |s| s.to_i }
|
@@ -133,7 +142,7 @@ if version[0] > 1 || version[1] > 8
|
|
133
142
|
TEST_CASES['Скорость=(Расстояние)/(Время)'] =
|
134
143
|
{
|
135
144
|
:mathml => '<math><mi>С</mi><mi>к</mi><mi>о</mi><mi>р</mi><mi>о</mi><mi>с</mi><mi>т</mi><mi>ь</mi><mo>=</mo><mfrac><mrow><mi>Р</mi><mi>а</mi><mi>с</mi><mi>с</mi><mi>т</mi><mi>о</mi><mi>я</mi><mi>н</mi><mi>и</mi><mi>е</mi></mrow><mrow><mi>В</mi><mi>р</mi><mi>е</mi><mi>м</mi><mi>я</mi></mrow></mfrac></math>',
|
136
|
-
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">С</span><span class="math-identifier">к</span><span class="math-identifier">о</span><span class="math-identifier">р</span><span class="math-identifier">о</span><span class="math-identifier">с</span><span class="math-identifier">т</span><span class="math-identifier">ь</span><span class="math-operator">=</span><span class="math-blank">&#
|
145
|
+
:html => '<span class="math-inline"><span class="math-row"><span class="math-identifier">С</span><span class="math-identifier">к</span><span class="math-identifier">о</span><span class="math-identifier">р</span><span class="math-identifier">о</span><span class="math-identifier">с</span><span class="math-identifier">т</span><span class="math-identifier">ь</span><span class="math-operator">=</span><span class="math-blank">‍</span><span class="math-fraction"><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">Р</span><span class="math-identifier">а</span><span class="math-identifier">с</span><span class="math-identifier">с</span><span class="math-identifier">т</span><span class="math-identifier">о</span><span class="math-identifier">я</span><span class="math-identifier">н</span><span class="math-identifier">и</span><span class="math-identifier">е</span></span></span></span></span></span><span class="math-fraction_row"><span class="math-fraction_cell"><span class="math-smaller"><span class="math-row"><span class="math-row"><span class="math-identifier">В</span><span class="math-identifier">р</span><span class="math-identifier">е</span><span class="math-identifier">м</span><span class="math-identifier">я</span></span></span></span></span></span></span></span></span>'
|
137
146
|
}
|
138
147
|
end
|
139
148
|
|
@@ -153,17 +162,18 @@ end
|
|
153
162
|
|
154
163
|
describe "AsciiMath::MathMLBuilder" do
|
155
164
|
TEST_CASES.each_pair do |asciimath, output|
|
156
|
-
it "
|
165
|
+
it "'#{asciimath}' to MathML" do
|
157
166
|
expect_mathml(asciimath, output[:mathml])
|
158
167
|
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "AsciiMath::HTMLBuilder" do
|
172
|
+
TEST_CASES.each_pair do |asciimath, output|
|
159
173
|
if output[:html]
|
160
|
-
it "
|
174
|
+
it "'#{asciimath}' to HTML" do
|
161
175
|
expect_html(asciimath, output[:html])
|
162
176
|
end
|
163
177
|
end
|
164
178
|
end
|
165
|
-
|
166
|
-
it 'should not generate mo elements for {: and :}' do
|
167
|
-
expect_mathml '{:(a,b),(c,d):}', '<math><mrow><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable></mrow></math>'
|
168
|
-
end
|
169
179
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciimath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pepijn Van Eeckhoudt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.5.1
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: AsciiMath parser and converter
|