isodoc 3.4.0 → 3.4.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18d33859f89e36a66412218c04370f02c727fe131dd91b73fd3671ab25cf228f
|
|
4
|
+
data.tar.gz: cc2996c38878a5acacf24932cf2719a1bef922cea11cf5c26411172e9a93032a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dde602b7132920dff5599dc3da2bb0de9ef027f5b3dd703fadc190adec9fab8e26901798bc208d3b3d279b57c5d19fa7ccbe885c37591da875e79f8dd5c364d4
|
|
7
|
+
data.tar.gz: 8d67a2d2518105cf854c7bb7f21a841de922785b0c77060e6002e6023c8de2b14efb8a9cbea25d140101183349b4b346287332eeb230b0c33aa5e0db3dcb3321
|
|
@@ -10,28 +10,29 @@ module IsoDoc
|
|
|
10
10
|
.gsub(%r{\]\]>\s*</script>}, "</script>")
|
|
11
11
|
.gsub(%r{<!\[CDATA\[\s*<script([^<>]*)>}m, "<script\\1>")
|
|
12
12
|
.gsub(%r{</script>\s*\]\]>}, "</script>")
|
|
13
|
+
.gsub(%r{<style([^<>]*)>\s*<!\[CDATA\[}m, "<style\\1>")
|
|
14
|
+
.gsub(%r{\]\]>\s*</style>}, "</style>")
|
|
15
|
+
.gsub(%r{<!\[CDATA\[\s*<style([^<>]*)>}m, "<style\\1>")
|
|
16
|
+
.gsub(%r{</style>\s*\]\]>}, "</style>")
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
def htmlstylesheet(file)
|
|
16
20
|
file.nil? and return
|
|
17
21
|
file.open if file.is_a?(Tempfile)
|
|
18
22
|
stylesheet = file.read
|
|
19
|
-
xml = Nokogiri::XML("<style/>")
|
|
20
|
-
xml.children.first << Nokogiri::XML::Comment
|
|
21
|
-
.new(xml, "\n#{stylesheet}\n")
|
|
22
23
|
file.close
|
|
23
24
|
file.unlink if file.is_a?(Tempfile)
|
|
24
|
-
|
|
25
|
+
stylesheet
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def htmlstyle(docxml)
|
|
28
29
|
@htmlstylesheet or return docxml
|
|
29
30
|
head = docxml.at("//*[local-name() = 'head']")
|
|
30
|
-
head << htmlstylesheet(@htmlstylesheet)
|
|
31
|
-
s = htmlstylesheet(@htmlstylesheet_override) and head << s
|
|
31
|
+
head << Nokogiri::HTML.fragment("<style>#{htmlstylesheet(@htmlstylesheet)}</style>")
|
|
32
|
+
s = htmlstylesheet(@htmlstylesheet_override) and head << Nokogiri::HTML.fragment("<style>#{s}</style>")
|
|
32
33
|
s = @meta.get[:code_css] and
|
|
33
|
-
head << "<style
|
|
34
|
-
|
|
34
|
+
head << Nokogiri::HTML.fragment("<style>#{s.gsub(/sourcecode/,
|
|
35
|
+
'pre.sourcecode')}</style>")
|
|
35
36
|
@bare and
|
|
36
37
|
head << "<style>body {margin-left: 2em; margin-right: 2em;}</style>"
|
|
37
38
|
docxml
|
|
@@ -25,6 +25,10 @@ module IsoDoc
|
|
|
25
25
|
|
|
26
26
|
def svgmap_extract(elem)
|
|
27
27
|
if elem.at(ns("./figure"))
|
|
28
|
+
if n1 = elem.next_element
|
|
29
|
+
n1.name == "semx" && n1["element"] == "svgmap" and return
|
|
30
|
+
end
|
|
31
|
+
|
|
28
32
|
n = semx_fmt_dup(elem)
|
|
29
33
|
n.xpath(ns("./target")).each(&:remove)
|
|
30
34
|
elem.next = n
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -63,18 +63,20 @@ module IsoDoc
|
|
|
63
63
|
|
|
64
64
|
def dl_table_attrs(node)
|
|
65
65
|
{ id: node["id"],
|
|
66
|
-
|
|
66
|
+
style: node["class"] == "formula_dl" ? "text-align:left;" : nil,
|
|
67
67
|
class: node["class"] || "dl" }
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def dl_parse_table(node, out)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
71
|
+
out.div **attr_code(align: "left") do |div|
|
|
72
|
+
list_title_parse(node, div)
|
|
73
|
+
div.table **attr_code(dl_table_attrs(node)) do |v|
|
|
74
|
+
node.elements.select { |n| dt_dd?(n) }
|
|
75
|
+
.each_slice(2) do |dt, dd|
|
|
76
|
+
dl_parse_table1(v, dt, dd)
|
|
77
|
+
end
|
|
78
|
+
dl_parse_table_notes(node, v)
|
|
76
79
|
end
|
|
77
|
-
dl_parse_table_notes(node, v)
|
|
78
80
|
end
|
|
79
81
|
end
|
|
80
82
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isodoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.4.
|
|
4
|
+
version: 3.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|