html2doc 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +9 -30
- data/html2doc.gemspec +1 -1
- data/lib/html2doc/math.rb +9 -3
- data/lib/html2doc/version.rb +1 -1
- data/spec/html2doc_spec.rb +8 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca7f6e33369a6f035f99d6189d72ef452e512af530b5dfea77b38a1c1104c8ee
|
4
|
+
data.tar.gz: 24aea1bed699c0a6e3f896e5a3807dad1aaf2436aea8019a50d1a250b1608796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc5ada9a3d07d80abd1c95b5abb9b9261b512b33f6a09a8a22edd107c206da50fdef555a394caa00fd5b96cc7eae412dc0ae78c532ac5b5aa8c53da1d6d725d4
|
7
|
+
data.tar.gz: 9aaafdc1b5e53cc1295e5ea6e305f6ebdcf3b0efb5b1d49ddc7028d8f24b9f2d66a2c973f145832f519ce58b6a0ab3b20f48cc927eaa9ed4d75ed06aa9466154
|
data/.github/workflows/rake.yml
CHANGED
@@ -4,7 +4,7 @@ name: rake
|
|
4
4
|
|
5
5
|
on:
|
6
6
|
push:
|
7
|
-
branches: [ master, main
|
7
|
+
branches: [ master, main ]
|
8
8
|
tags: [ v* ]
|
9
9
|
pull_request:
|
10
10
|
|
@@ -16,48 +16,27 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '2.6', '2.5', '2.4' ]
|
19
|
+
ruby: [ '2.7', '2.6', '2.5', '2.4' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
22
|
include:
|
23
|
-
- ruby: '
|
23
|
+
- ruby: '3.0'
|
24
24
|
os: 'ubuntu-latest'
|
25
25
|
experimental: true
|
26
|
-
- ruby: '
|
26
|
+
- ruby: '3.0'
|
27
27
|
os: 'windows-latest'
|
28
28
|
experimental: true
|
29
|
-
- ruby: '
|
29
|
+
- ruby: '3.0'
|
30
30
|
os: 'macos-latest'
|
31
31
|
experimental: true
|
32
32
|
steps:
|
33
|
-
- uses: actions/checkout@
|
33
|
+
- uses: actions/checkout@v2
|
34
|
+
with:
|
35
|
+
submodules: true
|
34
36
|
|
35
37
|
- uses: ruby/setup-ruby@v1
|
36
38
|
with:
|
37
39
|
ruby-version: ${{ matrix.ruby }}
|
38
|
-
|
39
|
-
- uses: actions/cache@v1
|
40
|
-
with:
|
41
|
-
path: vendor/bundle
|
42
|
-
key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
|
43
|
-
restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
|
44
|
-
|
45
|
-
- run: bundle config set path 'vendor/bundle'
|
46
|
-
|
47
|
-
- run: bundle install --jobs 4 --retry 3
|
40
|
+
bundler-cache: true
|
48
41
|
|
49
42
|
- run: bundle exec rake
|
50
|
-
|
51
|
-
notify:
|
52
|
-
name: Trigger notify workflow
|
53
|
-
needs: rake
|
54
|
-
runs-on: ubuntu-latest
|
55
|
-
steps:
|
56
|
-
- name: Trigger notify workflow
|
57
|
-
uses: Sibz/github-status-action@v1
|
58
|
-
with:
|
59
|
-
authToken: ${{ secrets.GITHUB_TOKEN }}
|
60
|
-
context: 'tests-passed-successfully'
|
61
|
-
description: 'Tests passed successfully'
|
62
|
-
state: 'success'
|
63
|
-
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
data/html2doc.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "nokogiri", "~> 1.10.4"
|
32
32
|
spec.add_dependency "thread_safe"
|
33
33
|
spec.add_dependency "uuidtools"
|
34
|
-
spec.add_dependency "asciimath", "~> 2.0.
|
34
|
+
spec.add_dependency "asciimath", "~> 2.0.2"
|
35
35
|
spec.add_dependency "plane1converter", "~> 0.0.1"
|
36
36
|
|
37
37
|
spec.add_development_dependency "byebug", "~> 9.1"
|
data/lib/html2doc/math.rb
CHANGED
@@ -10,9 +10,15 @@ module Html2Doc
|
|
10
10
|
encoding: "utf-8"))
|
11
11
|
|
12
12
|
def self.asciimath_to_mathml1(x)
|
13
|
-
|
14
|
-
AsciiMath.
|
15
|
-
|
13
|
+
begin
|
14
|
+
AsciiMath::MathMLBuilder.new(:msword => true).append_expression(
|
15
|
+
AsciiMath.parse(HTMLEntities.new.decode(x)).ast).to_s.
|
16
|
+
gsub(/<math>/, "<math xmlns='http://www.w3.org/1998/Math/MathML'>")
|
17
|
+
rescue StandardError => e
|
18
|
+
puts "parsing: #{x}"
|
19
|
+
puts e.message
|
20
|
+
raise e
|
21
|
+
end
|
16
22
|
end
|
17
23
|
|
18
24
|
def self.asciimath_to_mathml(doc, delims)
|
data/lib/html2doc/version.rb
CHANGED
data/spec/html2doc_spec.rb
CHANGED
@@ -467,6 +467,14 @@ RSpec.describe Html2Doc do
|
|
467
467
|
OUTPUT
|
468
468
|
end
|
469
469
|
|
470
|
+
it "raises error in processing of broken AsciiMath" do
|
471
|
+
begin
|
472
|
+
expect{ Html2Doc.process(html_input(%[<div style='text-align:right;'>{{u_c = 6.6"unitsml(kHz)}}</div>]), filename: "test", asciimathdelims: ["{{", "}}"]) }.to output('parsing: u_c = 6.6"unitsml(kHz)').to_stderr
|
473
|
+
rescue StandardError
|
474
|
+
end
|
475
|
+
expect{ Html2Doc.process(html_input(%[<div style='text-align:right;'>{{u_c = 6.6"unitsml(kHz)}}</div>]), filename: "test", asciimathdelims: ["{{", "}}"]) }.to raise_error(StandardError)
|
476
|
+
end
|
477
|
+
|
470
478
|
it "wraps msup after munderover in MathML" do
|
471
479
|
Html2Doc.process(html_input("<div><math xmlns='http://www.w3.org/1998/Math/MathML'>
|
472
480
|
<munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>0</mn></mrow><mrow><mi>n</mi></mrow></munderover><msup><mn>2</mn><mrow><mi>i</mi></mrow></msup></math></div>"), filename: "test", asciimathdelims: ["{{", "}}"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html2doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.0.
|
103
|
+
version: 2.0.2
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.0.
|
110
|
+
version: 2.0.2
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: plane1converter
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -336,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
336
|
- !ruby/object:Gem::Version
|
337
337
|
version: '0'
|
338
338
|
requirements: []
|
339
|
-
rubygems_version: 3.
|
339
|
+
rubygems_version: 3.1.4
|
340
340
|
signing_key:
|
341
341
|
specification_version: 4
|
342
342
|
summary: Convert HTML document to Microsoft Word document
|