plurimath 0.8.18 → 0.8.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/plurimath/math/formula.rb +4 -28
- data/lib/plurimath/math/symbols/symbol.rb +8 -1
- data/lib/plurimath/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674b18bd19282809f8e45b8d14b8249e67d7a80ae73df51bd678b2d15658dc36
|
4
|
+
data.tar.gz: a08def1749cece90982daf3ee329aa8a0a363d22fccceda9d41952f5f5d80afe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626a181a170618aab1033863339c9423c2b85d76baa6eca4dfb68b5fd5cb01f37714456dc023b565784256ecb8e4bb170708185fe29a2ff8cb089df26300c5e2
|
7
|
+
data.tar.gz: 228a1da3ed8378fcf82b2c894b1a056d83c03a2d88d40ed0059312937a2104280cdbeaf65801b2c2c35d0c4f573a318d6987eaecc29f57a99b7c732fb17b6c23
|
data/Gemfile
CHANGED
@@ -629,11 +629,11 @@ module Plurimath
|
|
629
629
|
end
|
630
630
|
|
631
631
|
def unitsml_post_processing(nodes, prev_node)
|
632
|
+
insert_index = 0
|
632
633
|
nodes.each.with_index do |node, index|
|
633
634
|
if node[:unitsml]
|
634
|
-
|
635
|
-
|
636
|
-
prev_node.insert_in_nodes(index, space_element(node)) if valid_previous?(pre_node)
|
635
|
+
prev_node.insert_in_nodes(index + insert_index, space_element(node))
|
636
|
+
insert_index += 1
|
637
637
|
node.remove_attr("unitsml")
|
638
638
|
end
|
639
639
|
unitsml_post_processing(node.nodes, node) if node.nodes.none?(String)
|
@@ -648,19 +648,10 @@ module Plurimath
|
|
648
648
|
|
649
649
|
def space_element(node)
|
650
650
|
element = (ox_element("mo") << "⁢")
|
651
|
-
element[:rspace] = "thickmathspace"
|
651
|
+
element[:rspace] = "thickmathspace"
|
652
652
|
element
|
653
653
|
end
|
654
654
|
|
655
|
-
def text_in_tag?(nodes)
|
656
|
-
next_nodes = nodes.first.nodes
|
657
|
-
if next_nodes.all?(String)
|
658
|
-
Utility.html_entity_to_unicode(next_nodes.first).match?(/\p{L}|\p{N}/)
|
659
|
-
else
|
660
|
-
text_in_tag?(next_nodes)
|
661
|
-
end
|
662
|
-
end
|
663
|
-
|
664
655
|
def negated_value?
|
665
656
|
value.last.is_a?(Math::Symbols::Symbol) && value.last.value == "̸"
|
666
657
|
end
|
@@ -670,21 +661,6 @@ module Plurimath
|
|
670
661
|
value&.map { |v| v.to_unicodemath(options: options) }&.join(join_str)
|
671
662
|
end
|
672
663
|
|
673
|
-
def valid_previous?(previous)
|
674
|
-
return unless previous
|
675
|
-
|
676
|
-
["mi", "mn"].include?(previous.name) ||
|
677
|
-
inside_tag?(previous)
|
678
|
-
end
|
679
|
-
|
680
|
-
def inside_tag?(previous)
|
681
|
-
previous&.nodes&.any? do |node|
|
682
|
-
next if node.is_a?(String)
|
683
|
-
|
684
|
-
valid_previous?(node) if node.xml_node?
|
685
|
-
end
|
686
|
-
end
|
687
|
-
|
688
664
|
def intent_attribute(mathml)
|
689
665
|
return unless mathml || value.length != 2
|
690
666
|
return unless valid_first_parameter?(value.first)
|
@@ -108,7 +108,10 @@ module Plurimath
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def t_tag(options:)
|
111
|
-
|
111
|
+
output = value || to_omml_without_math_tag(nil, options: options)
|
112
|
+
return t_element unless output
|
113
|
+
|
114
|
+
t_element << output
|
112
115
|
end
|
113
116
|
|
114
117
|
def separate_table
|
@@ -158,6 +161,10 @@ module Plurimath
|
|
158
161
|
|
159
162
|
private
|
160
163
|
|
164
|
+
def t_element
|
165
|
+
Utility.ox_element("t", namespace: "m")
|
166
|
+
end
|
167
|
+
|
161
168
|
def explicit_checks(unicode)
|
162
169
|
return true if [unicode, value].any? { |v| ["∣", "|"].include?(v) }
|
163
170
|
return true if unicode_const(:ACCENT_SYMBOLS).has_value?(value)
|
data/lib/plurimath/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plurimath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|