plurimath 0.11.3 → 0.11.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: 11ba1229615b89a47433de461270293407f476eb418c25601d69d04bcacc6f2a
4
- data.tar.gz: 9c8fa073f7edd18ba85a779fd5688c2bb6a8486a7bf668a34458efe543b59041
3
+ metadata.gz: b1bd22352f6fdea1f20d57cc552cb7c192f487de748ce69389ddd85c38bcaa2e
4
+ data.tar.gz: fc2c2959d8cf67c04566de3296b9002e4ef691f6786b540aac9a2ce243018230
5
5
  SHA512:
6
- metadata.gz: cabc87c386e4fd384ea4d29984c5dd7df09cd94a9204ae8a4fde4c4e9f8944361e5f04e96740b4d86e77ff9c30fd6fb66fd9ca49a1ea2b05b4a5aac6cab1c53e
7
- data.tar.gz: 2911f337795f3bf3420721e9760c3cacd9b773b645b08e139b361e5dc9e84b05e6eac91fba820c418e69b1aad83ec72cc38acae3cf94db264da3f9af87943711
6
+ metadata.gz: 60ade76c92676e02145a0db94913b1cbb07e7d14f03b11b53c6438bdc65c83fe661d037613b69d9dd2cd6fcc5c7d2de39e80275b8143eb8b5ae0506e28796815
7
+ data.tar.gz: ec5dc417656ad00f5b9cb96dcb95df5a4436fa793976f2f0bc13680d7be613787315992f20f81c349e628ef19c33f314f39ee0dec13d90dd597d6d6490164aec
data/lib/plurimath/cli.rb CHANGED
@@ -56,7 +56,7 @@ module Plurimath
56
56
  output_format = options[:output_format]
57
57
  configure_xml_engine(input_format, output_format)
58
58
  formula = Plurimath::Math.parse(input_string, input_format)
59
- return puts formula.to_display(output_format.to_sym) if YAML.safe_load(options[:math_rendering])
59
+ return puts formula.to_display(output_format.to_sym) if options[:math_rendering].to_s == "true"
60
60
 
61
61
  display_style = options[:display_style]
62
62
  split = options[:split_on_linebreak]
@@ -413,7 +413,7 @@ options:)
413
413
  end
414
414
 
415
415
  def boolean_display_style(display_style = displaystyle)
416
- YAML.safe_load(display_style.to_s)
416
+ display_style.to_s == "true"
417
417
  end
418
418
 
419
419
  def new_space(spacing, indent)
@@ -102,21 +102,36 @@ module Plurimath
102
102
  end
103
103
 
104
104
  def linebreak_child?(node, child)
105
+ return true if ct_br_child?(child)
106
+
105
107
  child == "" && node.respond_to?(:br) && node.br == ""
106
108
  end
107
109
 
110
+ def ct_br_child?(child)
111
+ return false unless child.is_a?(Object)
112
+
113
+ Lutaml::Model::Utils.base_class_name(child.class.name) == "CTBr"
114
+ end
115
+
108
116
  def styled_run?(children)
109
117
  children.length > 1 && !children.first.is_a?(Math::Core)
110
118
  end
111
119
 
112
120
  def styled_run_value(children)
113
- font = children.first
121
+ fonts, content = children.partition do |child|
122
+ font_style_class?(child)
123
+ end
124
+ font = fonts.first
114
125
  font.new(
115
- Utility.filter_values(children.drop(1)),
126
+ Utility.filter_values(content),
116
127
  Utility::FONT_STYLES.key(font).to_s,
117
128
  )
118
129
  end
119
130
 
131
+ def font_style_class?(value)
132
+ value.is_a?(Class) && value <= Math::Function::FontStyle
133
+ end
134
+
120
135
  def script_function_value(script_class, node)
121
136
  script_class.new(
122
137
  omml_argument_value(node.sub),
@@ -58,6 +58,8 @@ module Plurimath
58
58
  "CTCtrlPr", "CTBoxPr" then nil
59
59
  when "CTRPr" then word_run_properties_to_plurimath(node)
60
60
  when "CTRPR" then math_run_properties_to_plurimath(node)
61
+ when "CTBr" then Math::Function::Linebreak.new
62
+ when "CTWordprocessingEmpty", "CTWordprocessingText" then nil
61
63
  else
62
64
  unsupported_node!(node)
63
65
  end
@@ -552,7 +552,7 @@ lang: nil)
552
552
  if value.last.is_a?(Math::Function::UnaryFunction)
553
553
  value.last.parameter_one = value.shift if value.length > 1
554
554
  value.last.attributes = attrs.transform_values do |v|
555
- YAML.safe_load(v)
555
+ v.to_s == "true"
556
556
  end
557
557
  end
558
558
  value
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plurimath
4
- VERSION = "0.11.3"
4
+ VERSION = "0.11.4"
5
5
  end
data/plurimath.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "htmlentities"
32
32
  spec.add_dependency "lutaml-model", "~> 0.8.0"
33
33
  spec.add_dependency "mml", "~> 2.3.6"
34
- spec.add_dependency "omml", "~> 0.2.0"
34
+ spec.add_dependency "omml", "~> 0.2.5"
35
35
  spec.add_dependency "ostruct"
36
36
  spec.add_dependency "ox"
37
37
  spec.add_dependency "parslet"
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.11.3
4
+ version: 0.11.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: 2026-06-25 00:00:00.000000000 Z
11
+ date: 2026-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.0
75
+ version: 0.2.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.0
82
+ version: 0.2.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: ostruct
85
85
  requirement: !ruby/object:Gem::Requirement