isodoc 2.1.0.2 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9602bbd1d24d83b9b43f2ac41bd1b01d1fd9edf44c3edf4fbb97c45fb93e1292
4
- data.tar.gz: 5406db3babbfe8d4f7403b22a81e713081ba5de7c72f250c65bfeb08e98316e8
3
+ metadata.gz: aff7d421567c13d1c20aa58af56f75a5ef83d78c5268580cef8236b951e41f4d
4
+ data.tar.gz: 3f81f0d40caa3e069cc814195e565e824c5fd072a8ca408aa70ce2d7026862eb
5
5
  SHA512:
6
- metadata.gz: '0928611616ab02c2a0471ddd92c20bd79019a5c21c022d3a9989609919764f17837e1ae724e72de841b5ef31279537498193cb1ba06be3d65e2032f00bd684d6'
7
- data.tar.gz: 6edc16d70239d9106ce0114b92bb0e5f6b85a843fae3abe93456448bc8503d72015c096b12eaaedb3ca9e46cafa135d1b1dcc334781167d9c78a14084f7fe928
6
+ metadata.gz: 722f301c40200078c8753612504b5311bd5f1f87041143c9172b70a9b121066579ffb7fd9ce13ebce46a052360e105590fce318324a25175878685ca65958210
7
+ data.tar.gz: 1f78ddc58e32b347464eb1f73245fc85b4ddb3cb6ac5d27aa9bdaf6f0cc47dfd1db74e648e26ee8ad2860d28eef7530d503471a8ade31f572d9d495299ee033b
data/isodoc.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
31
  spec.add_dependency "asciimath"
32
- spec.add_dependency "html2doc", "~> 1.4.0"
32
+ spec.add_dependency "html2doc", "~> 1.4.1"
33
33
  spec.add_dependency "htmlentities", "~> 4.3.4"
34
34
  spec.add_dependency "isodoc-i18n", "~> 1.0.0"
35
35
  spec.add_dependency "liquid", "~> 4"
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency "emf2svg"
38
38
  spec.add_dependency "mathml2asciimath"
39
39
  spec.add_dependency "metanorma-utils"
40
- spec.add_dependency "nokogiri", "~> 1.12"
40
+
41
41
  spec.add_dependency "relaton-cli"
42
42
  spec.add_dependency "relaton-render", ">= 0.3.1"
43
43
  spec.add_dependency "roman-numerals"
@@ -0,0 +1,227 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, output, ruby, section, summary,
13
+ time, mark, audio, video {
14
+ margin: 0;
15
+ padding: 0; }
16
+
17
+ html, body, div, span, applet, object, iframe,
18
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
19
+ a, abbr, acronym, address, big, cite, code,
20
+ del, dfn, em, img, ins, kbd, q, s, samp,
21
+ small, strike, strong, sub, sup, tt, var,
22
+ b, u, i, center,
23
+ dl, dt, dd, ol, ul, li,
24
+ fieldset, form, label, legend,
25
+ table, caption, tbody, tfoot, thead, tr, th, td,
26
+ article, aside, canvas, details, embed,
27
+ figure, figcaption, footer, header, hgroup,
28
+ menu, nav, output, ruby, section, summary,
29
+ time, mark, audio, video {
30
+ border: 0;
31
+ font-size: 100%; }
32
+
33
+ html, body, div, span, applet, object, iframe,
34
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
35
+ a, abbr, acronym, address, big, cite, code,
36
+ del, dfn, em, img, ins, kbd, q, s, samp,
37
+ small, strike, strong, tt, var,
38
+ b, u, i, center,
39
+ dl, dd, ol, ul, li,
40
+ fieldset, form, label, legend,
41
+ table, caption, tbody, tfoot, thead, tr, th, td,
42
+ article, aside, canvas, details, embed,
43
+ figure, figcaption, footer, header, hgroup,
44
+ menu, nav, output, ruby, section, summary,
45
+ time, mark, audio, video {
46
+ vertical-align: baseline; }
47
+
48
+ html, body, div, span, applet, object, iframe,
49
+ p, blockquote,
50
+ a, abbr, acronym, address, big, cite,
51
+ del, dfn, em, img, ins, q, s,
52
+ small, strike, strong, sub, sup, var,
53
+ b, u, i, center,
54
+ dl, dt, dd, ol, ul, li,
55
+ fieldset, form, label, legend,
56
+ table, caption, tbody, tfoot, thead, tr, th, td,
57
+ article, aside, canvas, details, embed,
58
+ figure, figcaption, footer, header, hgroup,
59
+ menu, nav, output, ruby, section, summary,
60
+ time, mark, audio, video {
61
+ font-family: {{bodyfont}}; }
62
+
63
+ code, pre, tt, kbd, samp {
64
+ font-family: {{monospacefont}};
65
+ font-variant-ligatures: none; }
66
+
67
+ code *, pre *, tt *, kbd *, samp * {
68
+ font-family: {{monospacefont}} !important;
69
+ font-variant-ligatures: none; }
70
+
71
+ p code, dt code, li code, label code, legend code, caption code, th code, td code,
72
+ p tt, dt tt, li tt, label tt, legend tt, caption tt, th tt, td tt,
73
+ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
74
+ p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
75
+ font-size: {{monospacefontsize}}; }
76
+
77
+ article, aside, details, figcaption, figure,
78
+ footer, header, hgroup, menu, nav, section {
79
+ display: block; }
80
+
81
+ table {
82
+ border-collapse: collapse;
83
+ border-spacing: 0; }
84
+
85
+ h1, h2, h3, h4, h5, h6 {
86
+ font-family: {{headerfont}}; }
87
+
88
+ .h1, .h2, .h3, .h4, .h5, .h6 {
89
+ font-family: {{headerfont}}; }
90
+
91
+ blockquote, q {
92
+ quotes: none; }
93
+ blockquote:before, blockquote:after, q:before, q:after {
94
+ content: '';
95
+ content: none; }
96
+
97
+ .h2Annex {
98
+ font-family: {{headerfont}}; }
99
+
100
+ dl {
101
+ display: grid;
102
+ grid-template-columns: max-content auto; }
103
+ dl dt p, dl dd p {
104
+ margin-top: 0; }
105
+ dl dt {
106
+ grid-column-start: 1; }
107
+ dl dd {
108
+ grid-column-start: 2; }
109
+
110
+ b, strong {
111
+ font-weight: bold; }
112
+
113
+ div.document-stage-band, div.document-type-band {
114
+ background-color: #333333; }
115
+
116
+ a.FootnoteRef + a.FootnoteRef:before {
117
+ content: ", ";
118
+ vertical-align: super; }
119
+
120
+ .addition {
121
+ color: blue; }
122
+
123
+ .deletion {
124
+ color: red;
125
+ text-decoration: line-through; }
126
+
127
+ #standard-band {
128
+ background-color: #0AC442; }
129
+
130
+ #standard {
131
+ border-bottom: solid 3px #0AC442; }
132
+
133
+ #directive-band {
134
+ background-color: #540D6E; }
135
+
136
+ #directive {
137
+ border-bottom: solid 3px #540D6E; }
138
+
139
+ #guide-band {
140
+ background-color: #D183C9; }
141
+
142
+ #guide {
143
+ border-bottom: solid 3px #D183C9; }
144
+
145
+ #specification-band {
146
+ background-color: #65AFFF; }
147
+
148
+ #specification {
149
+ border-bottom: solid 3px #65AFFF; }
150
+
151
+ #report-band {
152
+ background-color: #3A405A; }
153
+
154
+ #report {
155
+ border-bottom: solid 3px #3A405A; }
156
+
157
+ #amendment-band {
158
+ background-color: #F26430; }
159
+
160
+ #amendment {
161
+ border-bottom: solid 3px #F26430; }
162
+
163
+ #corrigendum-band {
164
+ background-color: #C84630; }
165
+
166
+ #corrigendum {
167
+ border-bottom: solid 3px #C84630; }
168
+
169
+ #administrative-band {
170
+ background-color: #BFAE48; }
171
+
172
+ #administrative {
173
+ border-bottom: solid 3px #BFAE48; }
174
+
175
+ #advisory-band {
176
+ background-color: #BD9391; }
177
+
178
+ #advisory {
179
+ border-bottom: solid 3px #BD9391; }
180
+
181
+ #proposal-band {
182
+ background-color: #39A0ED; }
183
+
184
+ #proposal {
185
+ border-bottom: solid 3px #39A0ED; }
186
+
187
+ #working-draft-band {
188
+ background-color: #2D7393; }
189
+
190
+ #working-draft {
191
+ border-bottom: solid 3px #2D7393; }
192
+
193
+ #committee-draft-band {
194
+ background-color: #2A6B7C; }
195
+
196
+ #committee-draft {
197
+ border-bottom: solid 3px #2A6B7C; }
198
+
199
+ #draft-standard-band {
200
+ background-color: #1C7F7A; }
201
+
202
+ #draft-standard {
203
+ border-bottom: solid 3px #1C7F7A; }
204
+
205
+ #final-draft-band {
206
+ background-color: #53C170; }
207
+
208
+ #final-draft {
209
+ border-bottom: solid 3px #53C170; }
210
+
211
+ #published-band {
212
+ background-color: #069E2D; }
213
+
214
+ #published {
215
+ border-bottom: solid 3px #069E2D; }
216
+
217
+ #withdrawn-band {
218
+ background-color: #004E64; }
219
+
220
+ #withdrawn {
221
+ border-bottom: solid 3px #004E64; }
222
+
223
+ #cancelled-band {
224
+ background-color: #2E382E; }
225
+
226
+ #cancelled {
227
+ border-bottom: solid 3px #2E382E; }
File without changes
File without changes
File without changes
@@ -0,0 +1,47 @@
1
+ div.table_container {
2
+ margin-bottom: 14pt; }
3
+
4
+ ol {
5
+ margin-bottom: 0cm; }
6
+
7
+ ul {
8
+ margin-bottom: 0cm; }
9
+
10
+ table.MsoISOTable tr {
11
+ page-break-inside: avoid; }
12
+
13
+ td {
14
+ page-break-inside: avoid; }
15
+
16
+ tr {
17
+ page-break-after: avoid; }
18
+
19
+ table.MsoISOTableBig tr {
20
+ page-break-inside: auto; }
21
+
22
+ table.MsoISOTableBig td {
23
+ page-break-inside: auto; }
24
+
25
+ span.stem {
26
+ font-family: "Cambria Math",serif;
27
+ mso-ascii-font-family: "Cambria Math";
28
+ font-style: italic; }
29
+
30
+ dt {
31
+ page-break-inside: avoid;
32
+ page-break-after: avoid; }
33
+
34
+ br.section {
35
+ page-break-before: always;
36
+ mso-break-type: section-break; }
37
+
38
+ br.pagebreak {
39
+ page-break-before: always;
40
+ mso-special-character: line-break; }
41
+
42
+ span.addition {
43
+ color: blue; }
44
+
45
+ span.deletion {
46
+ color: red;
47
+ text-decoration: line-through; }
File without changes
@@ -0,0 +1,125 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, output, ruby, section, summary,
13
+ time, mark, audio, video {
14
+ margin: 0;
15
+ padding: 0; }
16
+
17
+ html, body, div, span, applet, object, iframe,
18
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
19
+ a, abbr, acronym, address, big, cite, code,
20
+ del, dfn, em, img, ins, kbd, q, s, samp,
21
+ small, strike, strong, sub, sup, tt, var,
22
+ b, u, i, center,
23
+ dl, dt, dd, ol, ul, li,
24
+ fieldset, form, label, legend,
25
+ table, caption, tbody, tfoot, thead, tr, th, td,
26
+ article, aside, canvas, details, embed,
27
+ figure, figcaption, footer, header, hgroup,
28
+ menu, nav, output, ruby, section, summary,
29
+ time, mark, audio, video {
30
+ border: 0;
31
+ font-size: 100%; }
32
+
33
+ html, body, div, span, applet, object, iframe,
34
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
35
+ a, abbr, acronym, address, big, cite, code,
36
+ del, dfn, em, img, ins, kbd, q, s, samp,
37
+ small, strike, strong, tt, var,
38
+ b, u, i, center,
39
+ dl, dd, ol, ul, li,
40
+ fieldset, form, label, legend,
41
+ table, caption, tbody, tfoot, thead, tr, th, td,
42
+ article, aside, canvas, details, embed,
43
+ figure, figcaption, footer, header, hgroup,
44
+ menu, nav, output, ruby, section, summary,
45
+ time, mark, audio, video {
46
+ vertical-align: baseline; }
47
+
48
+ html, body, div, span, applet, object, iframe,
49
+ p, blockquote,
50
+ a, abbr, acronym, address, big, cite,
51
+ del, dfn, em, img, ins, q, s,
52
+ small, strike, strong, sub, sup, var,
53
+ b, u, i, center,
54
+ dl, dt, dd, ol, ul, li,
55
+ fieldset, form, label, legend,
56
+ table, caption, tbody, tfoot, thead, tr, th, td,
57
+ article, aside, canvas, details, embed,
58
+ figure, figcaption, footer, header, hgroup,
59
+ menu, nav, output, ruby, section, summary,
60
+ time, mark, audio, video {
61
+ font-family: {{bodyfont}}; }
62
+
63
+ code, pre, tt, kbd, samp {
64
+ font-family: {{monospacefont}};
65
+ font-variant-ligatures: none; }
66
+
67
+ code *, pre *, tt *, kbd *, samp * {
68
+ font-family: {{monospacefont}} !important;
69
+ font-variant-ligatures: none; }
70
+
71
+ p code, dt code, li code, label code, legend code, caption code, th code, td code,
72
+ p tt, dt tt, li tt, label tt, legend tt, caption tt, th tt, td tt,
73
+ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
74
+ p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
75
+ font-size: {{monospacefontsize}}; }
76
+
77
+ article, aside, details, figcaption, figure,
78
+ footer, header, hgroup, menu, nav, section {
79
+ display: block; }
80
+
81
+ table {
82
+ border-collapse: collapse;
83
+ border-spacing: 0; }
84
+
85
+ h1, h2, h3, h4, h5, h6 {
86
+ font-family: {{headerfont}}; }
87
+
88
+ .h1, .h2, .h3, .h4, .h5, .h6 {
89
+ font-family: {{headerfont}}; }
90
+
91
+ blockquote, q {
92
+ quotes: none; }
93
+ blockquote:before, blockquote:after, q:before, q:after {
94
+ content: '';
95
+ content: none; }
96
+
97
+ .h2Annex {
98
+ font-family: {{headerfont}}; }
99
+
100
+ dl {
101
+ display: grid;
102
+ grid-template-columns: max-content auto; }
103
+ dl dt p, dl dd p {
104
+ margin-top: 0; }
105
+ dl dt {
106
+ grid-column-start: 1; }
107
+ dl dd {
108
+ grid-column-start: 2; }
109
+
110
+ b, strong {
111
+ font-weight: bold; }
112
+
113
+ div.document-stage-band, div.document-type-band {
114
+ background-color: #333333; }
115
+
116
+ a.FootnoteRef + a.FootnoteRef:before {
117
+ content: ", ";
118
+ vertical-align: super; }
119
+
120
+ .addition {
121
+ color: blue; }
122
+
123
+ .deletion {
124
+ color: red;
125
+ text-decoration: line-through; }
File without changes
@@ -7,7 +7,7 @@ module IsoDoc
7
7
  return date.text unless from || on || to
8
8
  return on.text if on
9
9
 
10
- ret = "#{from.text}–"
10
+ ret = "#{from.text}–"
11
11
  ret += to.text if to
12
12
  ret
13
13
  end
@@ -169,7 +169,7 @@ module IsoDoc
169
169
  return if author.nil? && source.nil?
170
170
 
171
171
  out.p **{ class: "QuoteAttribution" } do |p|
172
- p << "&mdash; #{author.text}" if author
172
+ p << "&#x2014; #{author.text}" if author
173
173
  p << ", " if author && source
174
174
  eref_parse(source, p) if source
175
175
  end
@@ -66,7 +66,7 @@ module IsoDoc
66
66
  title = d.at("./title")
67
67
  n = title.next_element
68
68
  n&.children&.first
69
- &.add_previous_sibling("#{title.remove.text}&mdash;")
69
+ &.add_previous_sibling("#{title.remove.text}&#x2014;")
70
70
  end
71
71
  docxml
72
72
  end
@@ -134,8 +134,8 @@ module IsoDoc
134
134
 
135
135
  text = node.to_s
136
136
  if in_sourcecode
137
- text = text.gsub("\n", "<br/>").gsub("<br/> ", "<br/>&nbsp;")
138
- .gsub(/ (?= )/, "&nbsp;")
137
+ text = text.gsub("\n", "<br/>").gsub("<br/> ", "<br/>&#xa0;")
138
+ .gsub(/ (?= )/, "&#xa0;")
139
139
  end
140
140
  out << text
141
141
  end
@@ -82,7 +82,7 @@ module IsoDoc
82
82
  node.xpath(ns("./note")).each { |n| parse(n, out) }
83
83
  end
84
84
  @in_table = false
85
- # out.p { |p| p << "&nbsp;" }
85
+ # out.p { |p| p << "&#xa0;" }
86
86
  end
87
87
 
88
88
  SW = "solid windowtext".freeze
@@ -73,14 +73,14 @@ module IsoDoc
73
73
 
74
74
  def make_body1(body, _docxml)
75
75
  body.div **{ class: "title-section" } do |div1|
76
- div1.p { |p| p << "&nbsp;" } # placeholder
76
+ div1.p { |p| p << "&#xa0;" } # placeholder
77
77
  end
78
78
  section_break(body)
79
79
  end
80
80
 
81
81
  def make_body2(body, _docxml)
82
82
  body.div **{ class: "prefatory-section" } do |div2|
83
- div2.p { |p| p << "&nbsp;" } # placeholder
83
+ div2.p { |p| p << "&#xa0;" } # placeholder
84
84
  end
85
85
  section_break(body)
86
86
  end
@@ -12,7 +12,7 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def insert_tab(out, count)
15
- tab = %w(Hans Hant).include?(@script) ? "&#x3000;" : "&nbsp; "
15
+ tab = %w(Hans Hant).include?(@script) ? "&#x3000;" : "&#xa0; "
16
16
  [1..count].each { out << tab }
17
17
  end
18
18
 
@@ -20,7 +20,7 @@ module IsoDoc
20
20
  return if @bare
21
21
 
22
22
  body.div **{ class: "title-section" } do |div1|
23
- div1.p { |p| p << "&nbsp;" } # placeholder
23
+ div1.p { |p| p << "&#xa0;" } # placeholder
24
24
  end
25
25
  section_break(body)
26
26
  end
@@ -29,7 +29,7 @@ module IsoDoc
29
29
  return if @bare
30
30
 
31
31
  body.div **{ class: "prefatory-section" } do |div2|
32
- div2.p { |p| p << "&nbsp;" } # placeholder
32
+ div2.p { |p| p << "&#xa0;" } # placeholder
33
33
  end
34
34
  section_break(body)
35
35
  end
@@ -31,7 +31,7 @@ module IsoDoc
31
31
  return if labelled_ancestor(elem)
32
32
 
33
33
  lbl = @xrefs.anchor(elem["id"], :label, false) or return
34
- prefix_name(elem, "&nbsp;&mdash; ",
34
+ prefix_name(elem, "&#xa0;&#x2014; ",
35
35
  l10n("#{lower2cap @i18n.figure} #{lbl}"), "name")
36
36
  end
37
37
 
@@ -60,7 +60,7 @@ module IsoDoc
60
60
  else
61
61
  l10n("#{@i18n.example} #{n[:label]}")
62
62
  end
63
- prefix_name(elem, "&nbsp;&mdash; ", lbl, "name")
63
+ prefix_name(elem, "&#xa0;&#x2014; ", lbl, "name")
64
64
  end
65
65
 
66
66
  def note(docxml)
@@ -130,7 +130,7 @@ module IsoDoc
130
130
  return if elem["unnumbered"] && !elem.at(ns("./name"))
131
131
 
132
132
  n = @xrefs.anchor(elem["id"], :label, false)
133
- prefix_name(elem, "&nbsp;&mdash; ", l10n("#{lower2cap @i18n.table} #{n}"),
133
+ prefix_name(elem, "&#xa0;&#x2014; ", l10n("#{lower2cap @i18n.table} #{n}"),
134
134
  "name")
135
135
  end
136
136
 
@@ -32,7 +32,7 @@ module IsoDoc
32
32
  return if elem.at(ns("./figure")) && !elem.at(ns("./name"))
33
33
 
34
34
  lbl = @xrefs.anchor(elem["id"], :label, false) or return
35
- prefix_name(elem, "&nbsp;&mdash; ",
35
+ prefix_name(elem, "&#xa0;&#x2014; ",
36
36
  l10n("#{lower2cap @i18n.figure} #{lbl}"), "name")
37
37
  end
38
38
 
@@ -158,7 +158,7 @@ module IsoDoc
158
158
  # TODO: move to localization file
159
159
  def eref_localities1_zh(_target, type, from, upto, node)
160
160
  ret = "第#{from}" if from
161
- ret += "&ndash;#{upto}" if upto
161
+ ret += "&#x2013;#{upto}" if upto
162
162
  loc = eref_locality_populate(type, node)
163
163
  ret += " #{loc}" unless node["droploc"] == "true"
164
164
  ret
@@ -172,7 +172,7 @@ module IsoDoc
172
172
  return l10n(eref_localities1_zh(target, type, from, upto, node))
173
173
  ret = eref_locality_populate(type, node)
174
174
  ret += " #{from}" if from
175
- ret += "&ndash;#{upto}" if upto
175
+ ret += "&#x2013;#{upto}" if upto
176
176
  l10n(ret)
177
177
  end
178
178
 
@@ -56,7 +56,7 @@ module IsoDoc
56
56
 
57
57
  def single_term_clause(elem)
58
58
  t = elem.at(ns("./terms | ./definitions | ./references"))
59
- t.at(ns("./title")).remove
59
+ t.at(ns("./title"))&.remove
60
60
  t.xpath(ns(".//clause | .//terms | .//definitions | .//references"))
61
61
  .each do |c|
62
62
  tit = c.at(ns("./title")) or return
@@ -84,6 +84,8 @@ module IsoDoc
84
84
  end
85
85
 
86
86
  def bibitem(xml)
87
+ @xrefs.klass.implicit_reference(xml) and
88
+ xml["hidden"] = "true"
87
89
  bibrender(xml)
88
90
  end
89
91
 
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "2.1.0.2".freeze
2
+ VERSION = "2.1.1".freeze
3
3
  end
@@ -20,7 +20,7 @@ module IsoDoc
20
20
 
21
21
  def make_body1(body, _docxml)
22
22
  body.div **{ class: "WordSection1" } do |div1|
23
- div1.p { |p| p << "&nbsp;" } # placeholder
23
+ div1.p { |p| p << "&#xa0;" } # placeholder
24
24
  end
25
25
  section_break(body)
26
26
  end
@@ -34,7 +34,7 @@ module IsoDoc
34
34
  introduction docxml, div2
35
35
  preface docxml, div2
36
36
  acknowledgements docxml, div2
37
- div2.p { |p| p << "&nbsp;" } # placeholder
37
+ div2.p { |p| p << "&#xa0;" } # placeholder
38
38
  end
39
39
  section_break(body)
40
40
  end
@@ -64,7 +64,7 @@ module IsoDoc
64
64
  def para_parse(node, out)
65
65
  out.p **attr_code(para_attrs(node)) do |p|
66
66
  unless @termdomain.empty?
67
- p << "&lt;#{@termdomain}&gt; "
67
+ p << "&#x3c;#{@termdomain}&#x3e; "
68
68
  @termdomain = ""
69
69
  end
70
70
  node.children.each { |n| parse(n, p) unless n.name == "note" }
@@ -187,7 +187,7 @@ module IsoDoc
187
187
  next unless t.children.empty?
188
188
 
189
189
  t["style"] = t["style"].sub(/;?$/, ";font-size:0pt;")
190
- t.children = "&nbsp;"
190
+ t.children = "&#xa0;"
191
191
  end
192
192
  end
193
193
 
@@ -60,7 +60,7 @@ module IsoDoc
60
60
  <span lang="EN-GB"><span
61
61
  style='mso-element:field-begin'></span><span
62
62
  style='mso-spacerun:yes'>&#xA0;</span>TOC
63
- \\o &quot;1-#{level}&quot; \\h \\z \\u <span
63
+ \\o "1-#{level}" \\h \\z \\u <span
64
64
  style='mso-element:field-separator'></span></span>
65
65
  TOC
66
66
  end
@@ -68,7 +68,7 @@ module IsoDoc
68
68
  WORD_TOC_SUFFIX1 = <<~TOC.freeze
69
69
  <p class="MsoToc1"><span lang="EN-GB"><span
70
70
  style='mso-element:field-end'></span></span><span
71
- lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
71
+ lang="EN-GB"><o:p>&#xA0;</o:p></span></p>
72
72
  TOC
73
73
 
74
74
  def make_WordToC(docxml, level)
@@ -86,7 +86,7 @@ module IsoDoc
86
86
  <span lang="EN-GB"><span
87
87
  style='mso-element:field-begin'></span><span
88
88
  style='mso-spacerun:yes'>&#xA0;</span>TOC
89
- \\h \\z \\t &quot;RecommendationTitle,RecommendationTestTitle,recommendationtitle,recommendationtesttitle&quot;
89
+ \\h \\z \\t "RecommendationTitle,RecommendationTestTitle,recommendationtitle,recommendationtesttitle"
90
90
  <span style='mso-element:field-separator'></span></span>
91
91
  TOC
92
92
 
@@ -94,7 +94,7 @@ module IsoDoc
94
94
  <span lang="EN-GB"><span
95
95
  style='mso-element:field-begin'></span><span
96
96
  style='mso-spacerun:yes'>&#xA0;</span>TOC
97
- \\h \\z \\t &quot;TableTitle,tabletitle&quot; <span
97
+ \\h \\z \\t "TableTitle,tabletitle" <span
98
98
  style='mso-element:field-separator'></span></span>
99
99
  TOC
100
100
 
@@ -102,7 +102,7 @@ module IsoDoc
102
102
  <span lang="EN-GB"><span
103
103
  style='mso-element:field-begin'></span><span
104
104
  style='mso-spacerun:yes'>&#xA0;</span>TOC
105
- \\h \\z \\t &quot;FigureTitle,figuretitle&quot; <span
105
+ \\h \\z \\t "FigureTitle,figuretitle" <span
106
106
  style='mso-element:field-separator'></span></span>
107
107
  TOC
108
108
 
@@ -113,7 +113,7 @@ RSpec.describe IsoDoc do
113
113
  :circulateddate=>"2015",
114
114
  :confirmeddate=>"2017",
115
115
  :copieddate=>"2016",
116
- :createddate=>"2010&ndash;2011",
116
+ :createddate=>"2010&#x2013;2011",
117
117
  :doc=>"URL E",
118
118
  :docnumber=>"17301-1",
119
119
  :docnumeric=>"17301",
@@ -529,7 +529,8 @@ RSpec.describe IsoDoc do
529
529
  word = File.read("test.doc")
530
530
  .sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
531
531
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
532
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
532
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
533
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
533
534
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
534
535
  <div class="WordSection2">
535
536
  /* an empty word intro page */
@@ -573,7 +574,6 @@ RSpec.describe IsoDoc do
573
574
  <span style="mso-element:field-end"></span>
574
575
  </span>
575
576
  <span lang="EN-GB" xml:lang="EN-GB">
576
- <p class="MsoNormal">&#xA0;</p>
577
577
  </span>
578
578
  </p>
579
579
  <p class="MsoNormal">&#xA0;</p>
@@ -611,7 +611,8 @@ RSpec.describe IsoDoc do
611
611
  word = File.read("test.doc")
612
612
  .sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
613
613
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
614
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
614
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
615
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
615
616
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
616
617
  <div class="WordSection2">
617
618
  /* an empty word intro page */
@@ -667,7 +668,6 @@ RSpec.describe IsoDoc do
667
668
  <span style="mso-element:field-end"></span>
668
669
  </span>
669
670
  <span lang="EN-GB" xml:lang="EN-GB">
670
- <p class="MsoNormal">&#xA0;</p>
671
671
  </span>
672
672
  </p>
673
673
  <p class="MsoNormal">&#xA0;</p>
@@ -719,7 +719,8 @@ RSpec.describe IsoDoc do
719
719
  word = File.read("test.doc")
720
720
  .sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
721
721
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
722
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
722
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
723
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
723
724
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
724
725
  <div class='WordSection2'>
725
726
  /* an empty word intro page */
@@ -830,7 +831,6 @@ RSpec.describe IsoDoc do
830
831
  <span style='mso-element:field-end'/>
831
832
  </span>
832
833
  <span lang='EN-GB' xml:lang='EN-GB'>
833
- <p class='MsoNormal'>&#xA0;</p>
834
834
  </span>
835
835
  </p>
836
836
  <p class='MsoNormal'>&#xA0;</p>
@@ -856,7 +856,8 @@ RSpec.describe IsoDoc do
856
856
  word = File.read("test.doc")
857
857
  .sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
858
858
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
859
- expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
859
+ expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")
860
+ .gsub(/<o:p>&#xA0;<\/o:p>/, "")))
860
861
  .to be_equivalent_to xmlpp(<<~'OUTPUT')
861
862
  <div class='WordSection2'>
862
863
  /* an empty word intro page */
@@ -967,7 +968,6 @@ RSpec.describe IsoDoc do
967
968
  <span style='mso-element:field-end'/>
968
969
  </span>
969
970
  <span lang='EN-GB' xml:lang='EN-GB'>
970
- <p class='MsoNormal'>&#xA0;</p>
971
971
  </span>
972
972
  </p>
973
973
  <p class='TOCTitle'>List of tables</p>
@@ -1006,7 +1006,6 @@ RSpec.describe IsoDoc do
1006
1006
  <span style='mso-element:field-end'/>
1007
1007
  </span>
1008
1008
  <span lang='EN-GB' xml:lang='EN-GB'>
1009
- <p class='MsoNormal'>&#xA0;</p>
1010
1009
  </span>
1011
1010
  </p>
1012
1011
  <p class='TOCTitle'>List of figures</p>
@@ -1045,7 +1044,6 @@ RSpec.describe IsoDoc do
1045
1044
  <span style='mso-element:field-end'/>
1046
1045
  </span>
1047
1046
  <span lang='EN-GB' xml:lang='EN-GB'>
1048
- <p class='MsoNormal'>&#xA0;</p>
1049
1047
  </span>
1050
1048
  </p>
1051
1049
  <p class='TOCTitle'>List of recommendations</p>
@@ -1133,7 +1131,6 @@ RSpec.describe IsoDoc do
1133
1131
  <span style='mso-element:field-end'/>
1134
1132
  </span>
1135
1133
  <span lang='EN-GB' xml:lang='EN-GB'>
1136
- <p class='MsoNormal'>&#xA0;</p>
1137
1134
  </span>
1138
1135
  </p>
1139
1136
  <p class='MsoNormal'>&#xA0;</p>
data/spec/spec_helper.rb CHANGED
@@ -22,6 +22,13 @@ RSpec.configure do |config|
22
22
  end
23
23
 
24
24
  def xmlpp(xml)
25
+ c = HTMLEntities.new
26
+ xml &&= xml.split(/(&\S+?;)/).map do |n|
27
+ if /^&\S+?;$/.match?(n)
28
+ c.encode(c.decode(n), :hexadecimal)
29
+ else n
30
+ end
31
+ end.join
25
32
  s = ""
26
33
  f = REXML::Formatters::Pretty.new(2)
27
34
  f.compact = true
@@ -30,7 +37,7 @@ def xmlpp(xml)
30
37
  end
31
38
 
32
39
  def metadata(hash)
33
- Hash[hash.sort].delete_if do |_k, v|
40
+ hash.sort.to_h.delete_if do |_k, v|
34
41
  v.nil? || (v.respond_to?(:empty?) && v.empty?)
35
42
  end
36
43
  end
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: 2.1.0.2
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-10 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.0
33
+ version: 1.4.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.0
40
+ version: 1.4.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: htmlentities
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: nokogiri
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '1.12'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '1.12'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: relaton-cli
141
127
  requirement: !ruby/object:Gem::Requirement
@@ -419,15 +405,23 @@ files:
419
405
  - lib/isodoc-yaml/i18n-ru.yaml
420
406
  - lib/isodoc-yaml/i18n-zh-Hans.yaml
421
407
  - lib/isodoc.rb
408
+ - lib/isodoc/base_style/all.css
422
409
  - lib/isodoc/base_style/all.scss
423
410
  - lib/isodoc/base_style/bands.scss
411
+ - lib/isodoc/base_style/blocks.css
424
412
  - lib/isodoc/base_style/blocks.scss
413
+ - lib/isodoc/base_style/coverpage.css
425
414
  - lib/isodoc/base_style/coverpage.scss
415
+ - lib/isodoc/base_style/defaults.css
426
416
  - lib/isodoc/base_style/defaults.scss
417
+ - lib/isodoc/base_style/metanorma_word.css
427
418
  - lib/isodoc/base_style/metanorma_word.scss
419
+ - lib/isodoc/base_style/nav.css
428
420
  - lib/isodoc/base_style/nav.scss
421
+ - lib/isodoc/base_style/reset.css
429
422
  - lib/isodoc/base_style/reset.scss
430
423
  - lib/isodoc/base_style/scripts.html
424
+ - lib/isodoc/base_style/typography.css
431
425
  - lib/isodoc/base_style/typography.scss
432
426
  - lib/isodoc/class_utils.rb
433
427
  - lib/isodoc/common.rb
@@ -542,7 +536,7 @@ homepage: https://github.com/metanorma/isodoc
542
536
  licenses:
543
537
  - BSD-2-Clause
544
538
  metadata: {}
545
- post_install_message:
539
+ post_install_message:
546
540
  rdoc_options: []
547
541
  require_paths:
548
542
  - lib
@@ -557,8 +551,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
557
551
  - !ruby/object:Gem::Version
558
552
  version: '0'
559
553
  requirements: []
560
- rubygems_version: 3.1.6
561
- signing_key:
554
+ rubygems_version: 3.3.9
555
+ signing_key:
562
556
  specification_version: 4
563
557
  summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
564
558
  test_files: []