isodoc 1.6.1 → 1.6.6
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/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +8 -2
- data/lib/isodoc/function/blocks.rb +15 -4
- data/lib/isodoc/function/cleanup.rb +52 -43
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +181 -163
- data/lib/isodoc/gem_tasks.rb +8 -9
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +6 -0
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -182
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +13 -11
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/inline.rb +70 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +3 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +2 -0
- data/lib/isodoc/xref/xref_counter.rb +1 -2
- data/lib/isodoc/xref/xref_gen.rb +21 -14
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +624 -997
- data/spec/isodoc/cleanup_spec.rb +40 -42
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +694 -821
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +461 -333
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +974 -932
- metadata +32 -7
@@ -0,0 +1,154 @@
|
|
1
|
+
term_def_boilerplate:
|
2
|
+
scope: Сфера применения
|
3
|
+
symbolsabbrev: Символы и сокращенные термины
|
4
|
+
abbrev: Сокращенные термины
|
5
|
+
symbols: Символы
|
6
|
+
table_of_contents: Содержание
|
7
|
+
introduction: Введение
|
8
|
+
foreword: Предисловие
|
9
|
+
abstract: Реферат
|
10
|
+
acknowledgements: Подтверждения
|
11
|
+
termsdef: Термины и определения
|
12
|
+
termsdefsymbolsabbrev: Термины, определения, символы и сокращенные термины
|
13
|
+
termsdefsymbols: Термины, определения и символы
|
14
|
+
termsdefabbrev: Термины, определения и сокращенные термины
|
15
|
+
normref: Нормативные ссылки
|
16
|
+
bibliography: Библиография
|
17
|
+
clause: Пункт
|
18
|
+
annex: Дополнение
|
19
|
+
appendix: Приложение
|
20
|
+
no_terms_boilerplate: |
|
21
|
+
<p>Термины и определения не перечислены в этом документе.</p>
|
22
|
+
internal_terms_boilerplate: |
|
23
|
+
<p>Для целей этого документа
|
24
|
+
применяются следующие термины и определения.</p>
|
25
|
+
norm_with_refs_pref:
|
26
|
+
Следующие документы упоминаются в тексте таким образом,
|
27
|
+
что некоторая часть или все их содержание являются требованиями
|
28
|
+
настоящего документа. Для датированных ссылок применяют только указанное издание.
|
29
|
+
Для недатированных ссылок применяют последнее издание
|
30
|
+
указанного документа (включая любые поправки).
|
31
|
+
norm_empty_pref:
|
32
|
+
Нет нормативных ссылок в этом документе.
|
33
|
+
external_terms_boilerplate: |
|
34
|
+
<p>Для целей этого документа применяются
|
35
|
+
термины и определения, данные в %.</p>
|
36
|
+
internal_external_terms_boilerplate: |
|
37
|
+
<p>Для целей этого документа применяются
|
38
|
+
термины и определения, данные в % и следующие.</p>
|
39
|
+
term_defined_in: "[термин, определенный в %]"
|
40
|
+
note: ПРИМЕЧАНИЕ
|
41
|
+
note_xref: Примечание
|
42
|
+
termnote: Примечание % к определению
|
43
|
+
list: Список
|
44
|
+
figure: Рисунок
|
45
|
+
formula: Формула
|
46
|
+
inequality: Формула
|
47
|
+
table: Таблица
|
48
|
+
requirement: Требование
|
49
|
+
recommendation: Рекомендация
|
50
|
+
permission: Разрешение
|
51
|
+
key: Условные обозначения
|
52
|
+
example: ПРИМЕР
|
53
|
+
example_xref: Пример
|
54
|
+
where: где
|
55
|
+
wholeoftext: Текст полностью
|
56
|
+
draft_label: проект
|
57
|
+
inform_annex: информативное
|
58
|
+
norm_annex: нормативное
|
59
|
+
modified: изменен
|
60
|
+
deprecated: НЕ РЕКОМЕНДУЕТСЯ
|
61
|
+
source: ИСТОЧНИК
|
62
|
+
and: и
|
63
|
+
all_parts: Все части
|
64
|
+
month_january: Январь
|
65
|
+
month_february: Февраль
|
66
|
+
month_march: Март
|
67
|
+
month_april: Апрель
|
68
|
+
month_may: Май
|
69
|
+
month_june: Июнь
|
70
|
+
month_july: Июль
|
71
|
+
month_august: Август
|
72
|
+
month_september: Сентябрь
|
73
|
+
month_october: Октябрь
|
74
|
+
month_november: Ноябрь
|
75
|
+
month_december: Декабрь
|
76
|
+
obligation: Обязательство
|
77
|
+
subject: Тема
|
78
|
+
inherits: Наследует
|
79
|
+
admonition: {
|
80
|
+
danger: Опасность,
|
81
|
+
warning: Предупреждение,
|
82
|
+
caution: Предостережение,
|
83
|
+
important: Важно,
|
84
|
+
safety precautions: Меры безопасности
|
85
|
+
}
|
86
|
+
locality: {
|
87
|
+
section: Раздел,
|
88
|
+
clause: Пункт,
|
89
|
+
part: Часть,
|
90
|
+
paragraph: Абзац,
|
91
|
+
chapter: Глава,
|
92
|
+
page: Стр.,
|
93
|
+
table: Таблица,
|
94
|
+
annex: Дополнение,
|
95
|
+
figure: Рисунок,
|
96
|
+
example: Пример,
|
97
|
+
note: Примечание,
|
98
|
+
formula: Формула
|
99
|
+
}
|
100
|
+
inflection:
|
101
|
+
Пункт:
|
102
|
+
sg: Пункт
|
103
|
+
pl: Пункты
|
104
|
+
Дополнение:
|
105
|
+
sg: Дополнение
|
106
|
+
pl: Дополнения
|
107
|
+
Приложение:
|
108
|
+
sg: Приложение
|
109
|
+
pl: Приложения
|
110
|
+
Примечание:
|
111
|
+
sg: Примечание
|
112
|
+
pl: Примечания
|
113
|
+
"Примечание % к записи":
|
114
|
+
sg: Примечание % к записи
|
115
|
+
pl: Примечания % к записи
|
116
|
+
Список:
|
117
|
+
sg: Список
|
118
|
+
pl: Списки
|
119
|
+
Рисунок:
|
120
|
+
sg: Рисунок
|
121
|
+
pl: Рисунки
|
122
|
+
Формула:
|
123
|
+
sg: Формула
|
124
|
+
pl: Формулы
|
125
|
+
Таблица:
|
126
|
+
sg: Таблица
|
127
|
+
pl: Таблицы
|
128
|
+
Требование:
|
129
|
+
sg: Требование
|
130
|
+
pl: Требования
|
131
|
+
Рекомендация:
|
132
|
+
sg: Рекомендация
|
133
|
+
pl: Рекомендации
|
134
|
+
Разрешение:
|
135
|
+
sg: Разрешение
|
136
|
+
pl: Разрешения
|
137
|
+
Пример:
|
138
|
+
sg: Пример
|
139
|
+
pl: Примеры
|
140
|
+
Часть:
|
141
|
+
sg: Часть
|
142
|
+
pl: Части
|
143
|
+
Раздел:
|
144
|
+
sg: Раздел
|
145
|
+
pl: Разделы
|
146
|
+
Абзац:
|
147
|
+
sg: Абзац
|
148
|
+
pl: Абзацы
|
149
|
+
Глава:
|
150
|
+
sg: Глава
|
151
|
+
pl: Главы
|
152
|
+
"Стр.":
|
153
|
+
sg: Стр.
|
154
|
+
pl: Стр.
|
data/lib/isodoc.rb
CHANGED
@@ -8,7 +8,6 @@ require "mime/types"
|
|
8
8
|
require "image_size"
|
9
9
|
require "set"
|
10
10
|
require "pp"
|
11
|
-
require "uuidtools"
|
12
11
|
require "html2doc"
|
13
12
|
require "liquid"
|
14
13
|
require "htmlentities"
|
@@ -26,5 +25,4 @@ require "isodoc/xref"
|
|
26
25
|
require "isodoc/i18n"
|
27
26
|
|
28
27
|
module IsoDoc
|
29
|
-
|
30
28
|
end
|
data/lib/isodoc/common.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative "./function/blocks"
|
2
2
|
require_relative "./function/cleanup"
|
3
|
+
require_relative "./function/form"
|
3
4
|
require_relative "./function/inline"
|
4
5
|
require_relative "./function/lists"
|
5
6
|
require_relative "./function/references"
|
@@ -15,6 +16,7 @@ module IsoDoc
|
|
15
16
|
class Common
|
16
17
|
include Function::Blocks
|
17
18
|
include Function::Cleanup
|
19
|
+
include Function::Form
|
18
20
|
include Function::Inline
|
19
21
|
include Function::Lists
|
20
22
|
include Function::References
|
data/lib/isodoc/convert.rb
CHANGED
@@ -8,7 +8,7 @@ require_relative "css"
|
|
8
8
|
|
9
9
|
module IsoDoc
|
10
10
|
class Convert < ::IsoDoc::Common
|
11
|
-
attr_accessor :options, :i18n, :meta
|
11
|
+
attr_accessor :options, :i18n, :meta, :xrefs
|
12
12
|
|
13
13
|
# htmlstylesheet: Generic stylesheet for HTML
|
14
14
|
# htmlstylesheet_override: Override stylesheet for HTML
|
@@ -32,10 +32,13 @@ module IsoDoc
|
|
32
32
|
# monospace: font to use for monospace text
|
33
33
|
# suppressheadingnumbers: suppress heading numbers for clauses
|
34
34
|
# scripts: Scripts file for HTML
|
35
|
+
# scripts_override: Override scripts file for HTML
|
35
36
|
# scripts_pdf: Scripts file for PDF (not used in XSLT PDF)
|
36
37
|
# datauriimage: Encode images in HTML output as data URIs
|
37
38
|
# break_up_urls_in_tables: whether to insert spaces in URLs in tables
|
38
39
|
# every 40-odd chars
|
40
|
+
# sectionsplit: split up HTML output on sections
|
41
|
+
# bare: do not insert any prefatory material (coverpage, boilerplate)
|
39
42
|
def initialize(options)
|
40
43
|
@libdir ||= File.dirname(__FILE__) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
|
41
44
|
options.merge!(default_fonts(options)) do |_, old, new|
|
@@ -64,12 +67,15 @@ module IsoDoc
|
|
64
67
|
@scripts = options[:scripts] ||
|
65
68
|
File.join(File.dirname(__FILE__), "base_style", "scripts.html")
|
66
69
|
@scripts_pdf = options[:scripts_pdf]
|
70
|
+
@scripts_override = options[:scripts_override]
|
67
71
|
@i18nyaml = options[:i18nyaml]
|
68
72
|
@ulstyle = options[:ulstyle]
|
69
73
|
@olstyle = options[:olstyle]
|
70
74
|
@datauriimage = options[:datauriimage]
|
71
75
|
@suppressheadingnumbers = options[:suppressheadingnumbers]
|
72
76
|
@break_up_urls_in_tables = options[:break_up_urls_in_tables] == "true"
|
77
|
+
@sectionsplit = options[:sectionsplit] == "true"
|
78
|
+
@bare = options[:bare]
|
73
79
|
@termdomain = ""
|
74
80
|
@termexample = false
|
75
81
|
@note = false
|
@@ -150,7 +156,7 @@ module IsoDoc
|
|
150
156
|
[docxml, filename, dir]
|
151
157
|
end
|
152
158
|
|
153
|
-
def convert(input_filename, file = nil, debug = false,
|
159
|
+
def convert(input_filename, file = nil, debug = false,
|
154
160
|
output_filename = nil)
|
155
161
|
file = File.read(input_filename, encoding: "utf-8") if file.nil?
|
156
162
|
@openmathdelim, @closemathdelim = extract_delims(file)
|
@@ -4,10 +4,21 @@ module IsoDoc::Function
|
|
4
4
|
module Blocks
|
5
5
|
@annotation = false
|
6
6
|
|
7
|
-
def
|
8
|
-
|
7
|
+
def middle_title(_isoxml, out)
|
8
|
+
out.p(**{ class: "zzSTDTitle1" }) { |p| p << @meta.get[:doctitle] }
|
9
|
+
end
|
10
|
+
|
11
|
+
def middle_admonitions(isoxml, out)
|
12
|
+
isoxml.xpath(ns("//sections/note | //sections/admonition")).each do |x|
|
13
|
+
parse(x, out)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def figure_name_parse(_node, div, name)
|
18
|
+
return if name.nil?
|
19
|
+
|
9
20
|
div.p **{ class: "FigureTitle", style: "text-align:center;" } do |p|
|
10
|
-
name.children.each { |n| parse(n,
|
21
|
+
name.children.each { |n| parse(n, p) }
|
11
22
|
end
|
12
23
|
end
|
13
24
|
|
@@ -51,7 +62,7 @@ module IsoDoc::Function
|
|
51
62
|
end
|
52
63
|
|
53
64
|
def sourcecode_name_parse(node, div, name)
|
54
|
-
return if name.nil?
|
65
|
+
return if name.nil?
|
55
66
|
|
56
67
|
div.p **{ class: "SourceTitle", style: "text-align:center;" } do |p|
|
57
68
|
name.children.each { |n| parse(n, p) }
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module IsoDoc::Function
|
2
2
|
module Cleanup
|
3
3
|
def textcleanup(docxml)
|
4
|
-
|
4
|
+
termref_cleanup(passthrough_cleanup(docxml))
|
5
5
|
end
|
6
6
|
|
7
7
|
def termref_cleanup(docxml)
|
8
|
-
docxml
|
9
|
-
gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/,
|
10
|
-
|
11
|
-
gsub(
|
12
|
-
gsub(
|
13
|
-
gsub(
|
8
|
+
docxml
|
9
|
+
.gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/,
|
10
|
+
l10n(", #{@i18n.modified} [/TERMREF]"))
|
11
|
+
.gsub(%r{\s*\[/TERMREF\]\s*</p>\s*<p>\s*\[TERMREF\]}, "; ")
|
12
|
+
.gsub(/\[TERMREF\]\s*/, l10n("[#{@i18n.source}: "))
|
13
|
+
.gsub(%r{\s*\[/TERMREF\]\s*}, l10n("]"))
|
14
|
+
.gsub(/\s*\[MODIFICATION\]/, l10n(", #{@i18n.modified} — "))
|
14
15
|
end
|
15
16
|
|
16
17
|
def passthrough_cleanup(docxml)
|
@@ -21,7 +22,7 @@ module IsoDoc::Function
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def cleanup(docxml)
|
24
|
-
@i18n ||= i18n_init(@lang, @script)
|
25
|
+
@i18n ||= i18n_init(@lang, @script)
|
25
26
|
comment_cleanup(docxml)
|
26
27
|
footnote_cleanup(docxml)
|
27
28
|
inline_header_cleanup(docxml)
|
@@ -34,30 +35,36 @@ module IsoDoc::Function
|
|
34
35
|
|
35
36
|
def table_long_strings_cleanup(docxml)
|
36
37
|
return unless @break_up_urls_in_tables == true
|
38
|
+
|
37
39
|
docxml.xpath("//td | //th").each do |d|
|
38
40
|
d.traverse do |n|
|
39
41
|
next unless n.text?
|
42
|
+
|
40
43
|
n.replace(HTMLEntities.new.encode(
|
41
|
-
|
44
|
+
break_up_long_strings(n.text),
|
45
|
+
))
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
46
|
-
def break_up_long_strings(
|
47
|
-
return
|
48
|
-
|
49
|
-
|
50
|
+
def break_up_long_strings(text)
|
51
|
+
return text if /^\s*$/.match?(text)
|
52
|
+
|
53
|
+
text.split(/(?=\s)/).map do |w|
|
54
|
+
if /^\s*$/.match(text) || (w.size < 30) then w
|
55
|
+
else
|
50
56
|
w.scan(/.{,30}/).map do |w1|
|
51
|
-
|
52
|
-
|
57
|
+
w1.size < 30 ? w1 : break_up_long_strings1(w1)
|
58
|
+
end.join
|
59
|
+
end
|
53
60
|
end.join
|
54
61
|
end
|
55
62
|
|
56
|
-
def break_up_long_strings1(
|
57
|
-
s =
|
58
|
-
if s.size == 1 then
|
63
|
+
def break_up_long_strings1(text)
|
64
|
+
s = text.split(%r{(?<=[,.?+;/=])})
|
65
|
+
if s.size == 1 then "#{text} "
|
59
66
|
else
|
60
|
-
s[-1] = "
|
67
|
+
s[-1] = " #{s[-1]}"
|
61
68
|
s.join
|
62
69
|
end
|
63
70
|
end
|
@@ -78,11 +85,11 @@ module IsoDoc::Function
|
|
78
85
|
docxml
|
79
86
|
end
|
80
87
|
|
81
|
-
def figure_get_or_make_dl(
|
82
|
-
dl =
|
88
|
+
def figure_get_or_make_dl(elem)
|
89
|
+
dl = elem.at(".//dl")
|
83
90
|
if dl.nil?
|
84
|
-
|
85
|
-
dl =
|
91
|
+
elem.add_child("<p><b>#{@i18n.key}</b></p><dl></dl>")
|
92
|
+
dl = elem.at(".//dl")
|
86
93
|
end
|
87
94
|
dl
|
88
95
|
end
|
@@ -91,10 +98,10 @@ module IsoDoc::Function
|
|
91
98
|
"//div[@class = 'figure'][descendant::aside]"\
|
92
99
|
"[not(descendant::div[@class = 'figure'])]".freeze
|
93
100
|
|
94
|
-
def figure_aside_process(
|
101
|
+
def figure_aside_process(elem, aside, key)
|
95
102
|
# get rid of footnote link, it is in diagram
|
96
|
-
|
97
|
-
fnref =
|
103
|
+
elem&.at("./a[@class='TableFootnoteRef']")&.remove
|
104
|
+
fnref = elem.at(".//span[@class='TableFootnoteRef']/..")
|
98
105
|
dt = key.add_child("<dt></dt>").first
|
99
106
|
dd = key.add_child("<dd></dd>").first
|
100
107
|
fnref.parent = dt
|
@@ -109,6 +116,7 @@ module IsoDoc::Function
|
|
109
116
|
def figure_cleanup(docxml)
|
110
117
|
docxml.xpath(FIGURE_WITH_FOOTNOTES).each do |f|
|
111
118
|
next unless f.at(".//aside[not(ancestor::p[@class = 'FigureTitle'])]")
|
119
|
+
|
112
120
|
key = figure_get_or_make_dl(f)
|
113
121
|
f.xpath(".//aside").each do |aside|
|
114
122
|
figure_aside_process(f, aside, key)
|
@@ -137,12 +145,13 @@ module IsoDoc::Function
|
|
137
145
|
docxml
|
138
146
|
end
|
139
147
|
|
140
|
-
def merge_fnref_into_fn_text(
|
141
|
-
fn =
|
148
|
+
def merge_fnref_into_fn_text(elem)
|
149
|
+
fn = elem.at('.//span[@class="TableFootnoteRef"]/..')
|
142
150
|
n = fn.next_element
|
143
151
|
n&.children&.first&.add_previous_sibling(fn.remove)
|
144
152
|
end
|
145
153
|
|
154
|
+
# preempt html2doc putting MsoNormal under TableFootnote class
|
146
155
|
def table_footnote_cleanup(docxml)
|
147
156
|
docxml.xpath("//table[descendant::aside]").each do |t|
|
148
157
|
t.xpath(".//aside").each do |a|
|
@@ -152,36 +161,36 @@ module IsoDoc::Function
|
|
152
161
|
t << a.remove
|
153
162
|
end
|
154
163
|
end
|
155
|
-
# preempt html2doc putting MsoNormal there
|
156
164
|
docxml.xpath("//p[not(self::*[@class])]"\
|
157
165
|
"[ancestor::*[@class = 'TableFootnote']]").each do |p|
|
158
166
|
p["class"] = "TableFootnote"
|
159
167
|
end
|
160
168
|
end
|
161
169
|
|
162
|
-
def remove_bottom_border(
|
163
|
-
|
164
|
-
|
170
|
+
def remove_bottom_border(cell)
|
171
|
+
cell["style"] =
|
172
|
+
cell["style"].gsub(/border-bottom:[^;]+;/, "border-bottom:0pt;")
|
165
173
|
end
|
166
174
|
|
167
|
-
def table_get_or_make_tfoot(
|
168
|
-
tfoot =
|
175
|
+
def table_get_or_make_tfoot(table)
|
176
|
+
tfoot = table.at(".//tfoot")
|
169
177
|
if tfoot.nil?
|
170
|
-
|
171
|
-
tfoot =
|
178
|
+
table.add_child("<tfoot></tfoot>")
|
179
|
+
tfoot = table.at(".//tfoot")
|
172
180
|
else
|
173
181
|
tfoot.xpath(".//td | .//th").each { |td| remove_bottom_border(td) }
|
174
182
|
end
|
175
183
|
tfoot
|
176
184
|
end
|
177
185
|
|
178
|
-
def new_fullcolspan_row(
|
186
|
+
def new_fullcolspan_row(table, tfoot)
|
179
187
|
# how many columns in the table?
|
180
188
|
cols = 0
|
181
|
-
|
189
|
+
table.at(".//tr").xpath("./td | ./th").each do |td|
|
182
190
|
cols += (td["colspan"] ? td["colspan"].to_i : 1)
|
183
191
|
end
|
184
|
-
style =
|
192
|
+
style =
|
193
|
+
%{border-top:0pt;border-bottom:#{IsoDoc::Function::Table::SW} 1.5pt;}
|
185
194
|
tfoot.add_child("<tr><td colspan='#{cols}' style='#{style}'/></tr>")
|
186
195
|
tfoot.xpath(".//td").last
|
187
196
|
end
|
@@ -206,12 +215,12 @@ module IsoDoc::Function
|
|
206
215
|
|
207
216
|
def symbols_cleanup(docxml); end
|
208
217
|
|
209
|
-
def table_footnote_reference_format(
|
210
|
-
|
218
|
+
def table_footnote_reference_format(link)
|
219
|
+
link
|
211
220
|
end
|
212
221
|
|
213
|
-
def footnote_reference_format(
|
214
|
-
|
222
|
+
def footnote_reference_format(link)
|
223
|
+
link
|
215
224
|
end
|
216
225
|
end
|
217
226
|
end
|