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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3125feede7c0e09e2760c586f23b5faed651a41cd69e6a515b37628dcbfb6461
4
- data.tar.gz: 834148b38b404bff32cda0ba16c948f5a505fe4f217cbc2c5815ce3da00f25b9
3
+ metadata.gz: 11547b56b21b1dc3c1b34bfa84e230c7e917258c80e094b4f39da986b6497720
4
+ data.tar.gz: aa06a261218c5445af439f0c88fbfd55ca97dc87c9c135fc489e58eb2dcead57
5
5
  SHA512:
6
- metadata.gz: 1128ead5ecc9efa1fdfa66aa2edcb53a644384d78d4702079e9f00ce1da9ac9eb9167f21de63779ef25bc41ad72484cc75839591acc8c0ff115a9e1cb7e10214
7
- data.tar.gz: c69cdf9204c9dcf431c605ac0686cba8b7e1f7c36c5263b9086b2763812e4745da29636e2f5b63b320ec6d22749cb159c8e71c84bff6675db95ea926ed15e1b6
6
+ metadata.gz: 45f920c409f2a1c6c3cab70dcf16ae2b432f4732c5491bab7de6ce6bc01f44d9f40df7325cce1d357ad74a11f3d043156276293f4e74c4e953fc5ff495185f23
7
+ data.tar.gz: 39994002be2a3f211eb6a4eb9826c63dcf6f06695ac65f42269479981436abad0969c054f3a68929847acbb35b4e3d56ebc1cb371916fadab8f0b824f1b96656
@@ -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 do |instance|
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(/&amp;(.*?)(?=<\/)/, '&\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
 
@@ -1,3 +1,3 @@
1
1
  module Unitsml
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
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.3
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 00:00:00.000000000 Z
11
+ date: 2025-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities