html2doc 1.8.6 → 1.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/html2doc.gemspec +1 -1
- data/lib/html2doc/mime.rb +3 -3
- data/lib/html2doc/version.rb +1 -1
- data/lib/html2doc/xml.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0422b53218377e4fa69b8c5c9f7fde68b95a726f29c145a5a2a8d24b098f712a
|
4
|
+
data.tar.gz: 40256fe7fd1e4ef1817c474fd7c977dfad28f0fd82760ed133d832158757e8dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584ddbe542c328d503751fcaa9c01540f0016e22c7988becea034da7e6721821814826233b90ab1e5e8f6e404d1007d9ad03664aab31ae43feb196b072a7056f
|
7
|
+
data.tar.gz: 27d2e012667344b73b13abb7a438552843b9cff8eff9d722d7aeb813a6eee3e801e57db8d187c90b4ecf62c587c75dd80957e04e19c5aa8f8771cbc822b4086e
|
data/html2doc.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
31
31
|
spec.add_dependency "metanorma-utils", ">= 1.9.0"
|
32
32
|
spec.add_dependency "mime-types"
|
33
|
-
spec.add_dependency "nokogiri", "~> 1.16"
|
33
|
+
spec.add_dependency "nokogiri", "~> 1.16.8"
|
34
34
|
spec.add_dependency "plane1converter", "~> 0.0.1"
|
35
35
|
spec.add_dependency "plurimath", "~> 0.8.0"
|
36
36
|
spec.add_dependency "thread_safe"
|
data/lib/html2doc/mime.rb
CHANGED
@@ -48,7 +48,7 @@ class Html2Doc
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def mime_boundary
|
51
|
-
salt = UUIDTools::UUID.random_create.to_s.
|
51
|
+
salt = UUIDTools::UUID.random_create.to_s.tr("-", ".")[0..17]
|
52
52
|
"----=_NextPart_#{salt}"
|
53
53
|
end
|
54
54
|
|
@@ -67,10 +67,10 @@ class Html2Doc
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def contentid(mhtml)
|
70
|
-
mhtml.gsub %r{(<img[
|
70
|
+
mhtml.gsub %r{(<img[^<>]*?src=")([^"'<]+)(['"])}m do |m|
|
71
71
|
repl = "#{$1}cid:#{File.basename($2)}#{$3}"
|
72
72
|
/^data:|^https?:/ =~ $2 ? m : repl
|
73
|
-
end.gsub %r{(<v:imagedata[
|
73
|
+
end.gsub %r{(<v:imagedata[^<>]*?src=")([^"'<]+)(['"])}m do |m|
|
74
74
|
repl = "#{$1}cid:#{File.basename($2)}#{$3}"
|
75
75
|
/^data:|^https?:/ =~ $2 ? m : repl
|
76
76
|
end
|
data/lib/html2doc/version.rb
CHANGED
data/lib/html2doc/xml.rb
CHANGED
@@ -8,12 +8,12 @@ class Html2Doc
|
|
8
8
|
HERE
|
9
9
|
|
10
10
|
def to_xhtml(xml)
|
11
|
-
xml.gsub!(/<\?xml[
|
11
|
+
xml.gsub!(/<\?xml[^<>]*>/, "")
|
12
12
|
unless /<!DOCTYPE /.match? xml
|
13
13
|
xml = '<!DOCTYPE html SYSTEM
|
14
14
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + xml
|
15
15
|
end
|
16
|
-
xml = xml.gsub(/<!--\s*\[([
|
16
|
+
xml = xml.gsub(/<!--\s*\[([^\<\]]+)\]>/, "<!-- MSWORD-COMMENT \\1 -->")
|
17
17
|
.gsub(/<!\s*\[endif\]\s*-->/, "<!-- MSWORD-COMMENT-END -->")
|
18
18
|
Nokogiri::XML.parse(xml)
|
19
19
|
end
|
@@ -38,7 +38,7 @@ class Html2Doc
|
|
38
38
|
'<span style="mso-special-character:footnote"></span>')
|
39
39
|
doc.gsub!(%r{<div style="mso-element:footnote-list"></div>},
|
40
40
|
'<div style="mso-element:footnote-list"/>')
|
41
|
-
doc.gsub!(%r{(<a style="mso-comment-reference:[
|
41
|
+
doc.gsub!(%r{(<a style="mso-comment-reference:[^<>/]+)/>}, "\\1></a>")
|
42
42
|
doc.gsub!(%r{<link rel="File-List"}, "<link rel=File-List")
|
43
43
|
doc.gsub!(%r{<meta http-equiv="Content-Type"},
|
44
44
|
"<meta http-equiv=Content-Type")
|
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.8.
|
4
|
+
version: 1.8.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: 2024-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.16.8
|
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:
|
82
|
+
version: 1.16.8
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: plane1converter
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|