html2doc 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0519bc0cdea11bd73e5ef3c07236793fc46ade0f08e7c36258e8fe0918808907'
4
- data.tar.gz: 919f5ee2632c524b30a72f5eb9f1c647c386eda1946aab89ea7f74e603e90aa1
3
+ metadata.gz: a7fc9d0eb6cd4bb7611c145794fe61c8d085b8ece41978e1b76e9c0124e6d4ed
4
+ data.tar.gz: 48f0e7bb2c806c702f956a68044d94e0cebdca9d9404acca1ad88099bae332e6
5
5
  SHA512:
6
- metadata.gz: 1c3c6b592ebff133758628ef1cd664a9c7e13390bd63551026c785992f0c6ae770d7593aa5052477e1aa08fedd033d749056857a9bb73b1e5babd4aa2e657ff4
7
- data.tar.gz: 907db4fb0ae7c64168c5b8436b1d2162591f05d9785928cb393d5e7ea4e7fddc086c96534a81e5d3f42df1c048df5c00b313e08f96dbb91a88b0dd95d3ee6774
6
+ metadata.gz: 2236ee4ee2447e3bcedfffbc226dcc605fac292247c1b46fc0ea411d90e66b8a99eb1647706c083cb23ff07f019dc8e752565aa3c27c7526d0d28ac5e4ad9307
7
+ data.tar.gz: 29e49ceed2cef4fbd1d3b233fe1d06137eb43ad54595690ee6b9dffeceed4d5fd050316adebe2c817e344bb2214a3251cbf5baee142e446e87841386060cd951
data/html2doc.gemspec CHANGED
@@ -26,12 +26,12 @@ Gem::Specification.new do |spec|
26
26
  end
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
28
28
 
29
- spec.add_dependency "asciimath", "~> 2.0.2"
30
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
31
- spec.add_dependency "image_size"
30
+ spec.add_dependency "image_size", ">= 3.2.0"
32
31
  spec.add_dependency "mime-types"
33
32
  spec.add_dependency "nokogiri", "~> 1.13"
34
33
  spec.add_dependency "plane1converter", "~> 0.0.1"
34
+ spec.add_dependency "plurimath"
35
35
  spec.add_dependency "thread_safe"
36
36
  spec.add_dependency "uuidtools"
37
37
 
data/lib/html2doc/base.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "uuidtools"
2
- require "asciimath"
3
2
  require "htmlentities"
4
3
  require "nokogiri"
5
4
  require "fileutils"
@@ -1,5 +1,4 @@
1
1
  require "uuidtools"
2
- require "asciimath"
3
2
  require "htmlentities"
4
3
  require "nokogiri"
5
4
 
data/lib/html2doc/math.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  require "uuidtools"
2
- require "asciimath"
2
+ require "plurimath"
3
3
  require "htmlentities"
4
4
  require "nokogiri"
5
5
  require "plane1converter"
6
6
 
7
7
  class Html2Doc
8
8
  def asciimath_to_mathml1(expr, retain_asciimath)
9
- ret = AsciiMath::MathMLBuilder.new(msword: true).append_expression(
10
- AsciiMath.parse(@c.decode(expr)).ast,
11
- ).to_s.gsub(/<math>/, "<math xmlns='http://www.w3.org/1998/Math/MathML'>")
9
+ warn expr
10
+ ret = Plurimath::Math.parse(HTMLEntities.new.decode(expr), "asciimath").to_mathml
11
+ .gsub(/<math>/, "<math xmlns='http://www.w3.org/1998/Math/MathML'>")
12
12
  retain_asciimath and
13
13
  ret += "<asciimath>#{@c.encode(@c.decode(expr), :basic)}</asciimath>"
14
14
  ret