isodoc 3.6.8 → 3.6.10
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 +4 -4
- data/lib/isodoc/function/table.rb +4 -4
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/table.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fed66e2a61e720a0c22c4f6041860f7e536be1f5a491a0167de4102757464c21
|
|
4
|
+
data.tar.gz: f8f81aa54bc89ce4ca860301a6aa86521dced4c2d9d274316db0472c6818d652
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87b58c730fb10c9ecd78f7138918c919206d70740a4afb1718d395ccff540559ce6916ad2b32fc2e66d44dafc98ffed220fa21e371f8dfcb9052130454466216
|
|
7
|
+
data.tar.gz: ba94cea74c951c49a48cee6bfa7481c35bb11dc19d70686c35176ffd58de52c916972acfcc88f652fbde4a4ee981fb3e6bc868f1454efb829951fc11a2a4d69e
|
|
@@ -50,11 +50,11 @@ module IsoDoc
|
|
|
50
50
|
# @class (metanorma/metanorma-pdfa#33). A non-plain table -- including one
|
|
51
51
|
# carrying a custom class, or the internal modspec variant -- keeps the
|
|
52
52
|
# ISO borders. The internal `rouge-line-table` (sourcecode line numbering)
|
|
53
|
-
#
|
|
54
|
-
# and
|
|
53
|
+
# and `dl` (a definition list rendered as a table) are exceptions: like
|
|
54
|
+
# %plain they are unbordered and mutually exclusive with MsoISOTable.
|
|
55
55
|
def bordered_table_style(node, klass = nil)
|
|
56
56
|
node["plain"] == "true" and return ""
|
|
57
|
-
|
|
57
|
+
%w(rouge-line-table dl).include?(klass) and return ""
|
|
58
58
|
"border-width:1px;border-spacing:0;"
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -169,7 +169,7 @@ module IsoDoc
|
|
|
169
169
|
def table_bordered?(node)
|
|
170
170
|
table = node.parent.parent
|
|
171
171
|
table["plain"] == "true" and return false
|
|
172
|
-
table["class"]
|
|
172
|
+
%w(rouge-line-table dl).include?(table["class"]) and return false
|
|
173
173
|
true
|
|
174
174
|
end
|
|
175
175
|
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -18,7 +18,7 @@ module IsoDoc
|
|
|
18
18
|
table.at(".//tr").xpath("./td | ./th").each do |td|
|
|
19
19
|
cols += (td["colspan"] ? td["colspan"].to_i : 1)
|
|
20
20
|
end
|
|
21
|
-
table["plain"] == "true" or
|
|
21
|
+
table["plain"] == "true" || table["class"] == "dl" or
|
|
22
22
|
s = "style='border-top:0pt;mso-border-top-alt:0pt;" \
|
|
23
23
|
"border-bottom:#{SW1} 1.5pt;mso-border-bottom-alt:#{SW1} 1.5pt;'"
|
|
24
24
|
tfoot.add_child("<tr><td colspan='#{cols}' #{s}/></tr>")
|
|
@@ -94,13 +94,18 @@ module IsoDoc
|
|
|
94
94
|
# survives. metanorma/metanorma-pdfa#33
|
|
95
95
|
def table_border_css(node)
|
|
96
96
|
style = "border-spacing:0;border-width:1px;"
|
|
97
|
-
node["style"] || node["plain"] == "true"
|
|
97
|
+
node["style"] || node["plain"] == "true" ||
|
|
98
|
+
node["class"] == "dl" and style = ""
|
|
98
99
|
node["class"] == "rouge-line-table" and style = nil
|
|
99
100
|
style
|
|
100
101
|
end
|
|
101
102
|
|
|
103
|
+
# `dl` (definition list rendered as a table) is unbordered like %plain, and
|
|
104
|
+
# takes the plain MsoNormalTable Word style rather than the bordered
|
|
105
|
+
# MsoISOTable.
|
|
102
106
|
def table_class(node)
|
|
103
|
-
node["plain"] == "true"
|
|
107
|
+
node["plain"] == "true" || node["class"] == "dl" and
|
|
108
|
+
return "MsoNormalTable"
|
|
104
109
|
node.text.length > 4000 ? "MsoISOTableBig" : "MsoISOTable"
|
|
105
110
|
end
|
|
106
111
|
|