plurimath 0.8.18 → 0.8.19
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/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: c4e85060f4518be4f3e9a5c711949f75cbc9305b139c78b3305c7af8beff7774
|
4
|
+
data.tar.gz: 2119f426507bc22d27c98989f1841c584f2691451afd6962637c725c9c1762a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d57d80296f733bf0980788e91c94a6ac0d3b525edc0e2276a3d55120d14cbc2976e9beadcfdd46320fcf4f57690f15d9dbe4313a59a2fd74723c68565546d7
|
7
|
+
data.tar.gz: bda92db07c284ac005ef82d255a0c60e85935805d2f8fa66db56b73272c0c90e9daa4c6e99df69cf77cd47678bfadf8b50ae715d2264d4d853848d4514ead7a4
|
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)
|
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.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|