unitsml 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/unitsml/formula.rb +10 -9
- data/lib/unitsml/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: 11547b56b21b1dc3c1b34bfa84e230c7e917258c80e094b4f39da986b6497720
|
4
|
+
data.tar.gz: aa06a261218c5445af439f0c88fbfd55ca97dc87c9c135fc489e58eb2dcead57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f920c409f2a1c6c3cab70dcf16ae2b432f4732c5491bab7de6ce6bc01f44d9f40df7325cce1d357ad74a11f3d043156276293f4e74c4e953fc5ff495185f23
|
7
|
+
data.tar.gz: 39994002be2a3f211eb6a4eb9826c63dcf6f06695ac65f42269479981436abad0969c054f3a68929847acbb35b4e3d56ebc1cb371916fadab8f0b824f1b96656
|
data/lib/unitsml/formula.rb
CHANGED
@@ -33,15 +33,7 @@ module Unitsml
|
|
33
33
|
math = ::Mml::MathWithNamespace.new(display: "block")
|
34
34
|
math.ordered = true
|
35
35
|
math.element_order ||= []
|
36
|
-
value.each
|
37
|
-
processed_instance = instance.to_mathml(options)
|
38
|
-
case processed_instance
|
39
|
-
when Array
|
40
|
-
processed_instance.each { |hash| add_math_element(math, hash) }
|
41
|
-
when Hash
|
42
|
-
add_math_element(math, processed_instance)
|
43
|
-
end
|
44
|
-
end
|
36
|
+
value.each { |instance| process_value(math, instance.to_mathml(options)) }
|
45
37
|
reset_mml_models if plurimath_available?
|
46
38
|
math.to_xml.gsub(/&(.*?)(?=<\/)/, '&\1')
|
47
39
|
else
|
@@ -186,6 +178,15 @@ module Unitsml
|
|
186
178
|
::Mml::Configuration.custom_models = Plurimath::Mathml::Parser::CONFIGURATION
|
187
179
|
end
|
188
180
|
|
181
|
+
def process_value(math, mathml_instances)
|
182
|
+
case mathml_instances
|
183
|
+
when Array
|
184
|
+
mathml_instances.each { |hash| process_value(math, hash) }
|
185
|
+
when Hash
|
186
|
+
add_math_element(math, mathml_instances)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
189
190
|
def update_options(options)
|
190
191
|
return options unless root
|
191
192
|
|
data/lib/unitsml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unitsml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|