isodoc 1.6.7.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +1,37 @@
1
1
  require "roman-numerals"
2
2
 
3
- module IsoDoc::XrefGen
4
- class Counter
5
- def initialize(num = 0, opts = { numerals: :arabic })
6
- @num = num
7
- @letter = ""
8
- @subseq = ""
9
- @letter_override = nil
10
- @number_override = nil
11
- @style = opts[:numerals]
12
- @skip_i = opts[:skip_i]
13
- @base = ""
14
- if num.is_a? String
15
- if /^\d+$/.match?(num)
16
- @num = num.to_i
17
- else
18
- @num = nil
19
- @base = num[0..-2]
20
- @letter = num[-1]
3
+ module IsoDoc
4
+ module XrefGen
5
+ class Counter
6
+ def initialize(num = 0, opts = { numerals: :arabic })
7
+ @num = num
8
+ @letter = ""
9
+ @subseq = ""
10
+ @letter_override = nil
11
+ @number_override = nil
12
+ @style = opts[:numerals]
13
+ @skip_i = opts[:skip_i]
14
+ @base = ""
15
+ if num.is_a? String
16
+ if /^\d+$/.match?(num)
17
+ @num = num.to_i
18
+ else
19
+ @num = nil
20
+ @base = num[0..-2]
21
+ @letter = num[-1]
22
+ end
21
23
  end
22
24
  end
23
- end
24
25
 
25
- def new_subseq_increment(node)
26
- @subseq = node["subsequence"]
27
- @num += 1 unless @num.nil?
28
- @letter = node["subsequence"] ? "a" : ""
29
- @base = ""
30
- if node["number"]
26
+ def new_subseq_increment(node)
27
+ @subseq = node["subsequence"]
28
+ @num += 1 unless @num.nil?
29
+ @letter = node["subsequence"] ? "a" : ""
30
+ @base = ""
31
+ new_subseq_increment1(node) if node["number"]
32
+ end
33
+
34
+ def new_subseq_increment1(node)
31
35
  /^(?<b>.*?)(?<n>\d*)(?<a>[a-zA-Z]*)$/ =~ node["number"]
32
36
  if !n.empty? || !a.empty?
33
37
  @letter_override = @letter = a unless a.empty?
@@ -38,108 +42,114 @@ module IsoDoc::XrefGen
38
42
  @letter = @letter_override if /^[a-zA-Z]$/.match?(@letter_override)
39
43
  end
40
44
  end
41
- end
42
45
 
43
- def sequence_increment(node)
44
- if node["number"]
45
- @base = @letter_override = @number_override = ""
46
- /^(?<b>.*?)(?<n>\d+)$/ =~ node["number"]
47
- if blank?(n)
48
- @num = nil
49
- @base = node["number"][0..-2]
50
- @letter = @letter_override = node["number"][-1]
51
- else
52
- @number_override = @num = n.to_i
53
- @base = b
54
- @letter = ""
46
+ def sequence_increment(node)
47
+ if node["number"]
48
+ @base = @letter_override = @number_override = ""
49
+ /^(?<b>.*?)(?<n>\d+)$/ =~ node["number"]
50
+ if blank?(n)
51
+ @num = nil
52
+ @base = node["number"][0..-2]
53
+ @letter = @letter_override = node["number"][-1]
54
+ else
55
+ @number_override = @num = n.to_i
56
+ @base = b
57
+ @letter = ""
58
+ end
59
+ else @num += 1
55
60
  end
56
- else
57
- @num += 1
58
61
  end
59
- end
60
62
 
61
- def subsequence_increment(node)
62
- if node["number"]
63
+ def subsequence_increment(node)
64
+ return increment_letter unless node["number"]
65
+
63
66
  @base = ""
64
67
  @letter_override = node["number"]
65
68
  /^(?<b>.*?)(?<n>\d*)(?<a>[a-zA-Z])$/ =~ node["number"]
66
- if blank?(a)
67
- if /^\d+$/.match?(node["number"])
68
- @letter_override = @letter = ""
69
- @number_override = @num = node["number"].to_i
70
- else
71
- /^(?<b>.*)(?<a>[a-zA-Z])$/ =~ node["number"]
72
- unless blank?(a)
73
- @letter = @letter_override = a
74
- @base = b
75
- end
76
- end
69
+ if blank?(a) then subsequence_increment_no_letter(node)
77
70
  else
78
71
  @letter_override = @letter = a
79
72
  @base = b
80
73
  @number_override = @num = n.to_i unless n.empty?
81
74
  end
82
- else
83
- increment_letter
84
75
  end
85
- end
86
76
 
87
- def increment_letter
88
- case @letter
89
- when "Z"
90
- @letter = "@"
91
- @base = @base.empty? ? "A" : @base[0..-2] + (@base[-1].ord + 1).chr.to_s
92
- when "z"
93
- @letter = "`"
94
- @base = @base.empty? ? "a" : @base[0..-2] + (@base[-1].ord + 1).chr.to_s
77
+ def subsequence_increment_no_letter(node)
78
+ if /^\d+$/.match?(node["number"])
79
+ @letter_override = @letter = ""
80
+ @number_override = @num = node["number"].to_i
81
+ else
82
+ /^(?<b>.*)(?<a>[a-zA-Z])$/ =~ node["number"]
83
+ unless blank?(a)
84
+ @letter = @letter_override = a
85
+ @base = b
86
+ end
87
+ end
88
+ end
89
+
90
+ def string_inc(str, start)
91
+ return start if str.empty?
92
+
93
+ str[0..-2] + (str[-1].ord + 1).chr.to_s
95
94
  end
96
- @letter = (@letter.ord + 1).chr.to_s
97
- @skip_i && %w(i I).include?(@letter) and
95
+
96
+ def increment_letter
97
+ case @letter
98
+ when "Z"
99
+ @letter = "@"
100
+ @base = string_inc(@base, "A")
101
+ when "z"
102
+ @letter = "`"
103
+ @base = string_inc(@base, "a")
104
+ end
98
105
  @letter = (@letter.ord + 1).chr.to_s
99
- end
106
+ @skip_i && %w(i I).include?(@letter) and
107
+ @letter = (@letter.ord + 1).chr.to_s
108
+ end
100
109
 
101
- def blank?(str)
102
- str.nil? || str.empty?
103
- end
110
+ def blank?(str)
111
+ str.nil? || str.empty?
112
+ end
104
113
 
105
- def increment(node)
106
- return self if node["unnumbered"]
114
+ def increment(node)
115
+ return self if node["unnumbered"]
107
116
 
108
- @letter_override = nil
109
- @number_override = nil
110
- if node["subsequence"] != @subseq &&
111
- !(blank?(node["subsequence"]) && blank?(@subseq))
112
- new_subseq_increment(node)
113
- elsif @letter.empty? then sequence_increment(node)
114
- else subsequence_increment(node)
117
+ @letter_override = nil
118
+ @number_override = nil
119
+ if node["subsequence"] != @subseq &&
120
+ !(blank?(node["subsequence"]) && blank?(@subseq))
121
+ new_subseq_increment(node)
122
+ elsif @letter.empty? then sequence_increment(node)
123
+ else subsequence_increment(node)
124
+ end
125
+ self
115
126
  end
116
- self
117
- end
118
127
 
119
- def print
120
- num = @number_override || @num
121
- out = @style == :roman && !num.nil? ? RomanNumerals.to_roman(num) : num
122
- "#{@base}#{out}#{@letter_override || @letter}"
123
- end
128
+ def print
129
+ num = @number_override || @num
130
+ out = @style == :roman && !num.nil? ? RomanNumerals.to_roman(num) : num
131
+ "#{@base}#{out}#{@letter_override || @letter}"
132
+ end
124
133
 
125
- def ol_type(list, depth)
126
- return list["type"].to_sym if list["type"]
127
- return :arabic if [2, 7].include? depth
128
- return :alphabet if [1, 6].include? depth
129
- return :alphabet_upper if [4, 9].include? depth
130
- return :roman if [3, 8].include? depth
131
- return :roman_upper if [5, 10].include? depth
134
+ def ol_type(list, depth)
135
+ return list["type"].to_sym if list["type"]
136
+ return :arabic if [2, 7].include? depth
137
+ return :alphabet if [1, 6].include? depth
138
+ return :alphabet_upper if [4, 9].include? depth
139
+ return :roman if [3, 8].include? depth
140
+ return :roman_upper if [5, 10].include? depth
132
141
 
133
- :arabic
134
- end
142
+ :arabic
143
+ end
135
144
 
136
- def listlabel(list, depth)
137
- case ol_type(list, depth)
138
- when :arabic then @num.to_s
139
- when :alphabet then (96 + @num).chr.to_s
140
- when :alphabet_upper then (64 + @num).chr.to_s
141
- when :roman then RomanNumerals.to_roman(@num).downcase
142
- when :roman_upper then RomanNumerals.to_roman(@num).upcase
145
+ def listlabel(list, depth)
146
+ case ol_type(list, depth)
147
+ when :arabic then @num.to_s
148
+ when :alphabet then (96 + @num).chr.to_s
149
+ when :alphabet_upper then (64 + @num).chr.to_s
150
+ when :roman then RomanNumerals.to_roman(@num).downcase
151
+ when :roman_upper then RomanNumerals.to_roman(@num).upcase
152
+ end
143
153
  end
144
154
  end
145
155
  end
@@ -3,7 +3,7 @@ require_relative "xref_gen_seq"
3
3
  module IsoDoc::XrefGen
4
4
  module Blocks
5
5
  NUMBERED_BLOCKS = %w(termnote termexample note example requirement
6
- recommendation permission figure table formula admonition sourcecode).freeze
6
+ recommendation permission figure table formula admonition sourcecode).freeze
7
7
 
8
8
  def amend_preprocess(xmldoc)
9
9
  xmldoc.xpath(ns("//amend[newcontent]")).each do |a|
@@ -60,9 +60,9 @@ module IsoDoc::XrefGen
60
60
 
61
61
  c.increment(n)
62
62
  idx = increment_label(examples, n, c, false)
63
- @anchors[n["id"]] = {
64
- type: "termexample", label: idx, value: c.print,
65
- xref: l10n("#{anchor(t['id'], :xref)}, "\
63
+ @anchors[n["id"]] =
64
+ { type: "termexample", label: idx, value: c.print,
65
+ xref: l10n("#{anchor(t['id'], :xref)}, "\
66
66
  "#{@labels['example_xref']} #{c.print}") }
67
67
  end
68
68
  end
@@ -86,9 +86,8 @@ module IsoDoc::XrefGen
86
86
 
87
87
  def note_anchor_names(sections)
88
88
  sections.each do |s|
89
- notes = s.xpath(CHILD_NOTES_XPATH)
90
89
  c = Counter.new
91
- notes.each do |n|
90
+ (notes = s.xpath(CHILD_NOTES_XPATH)).each do |n|
92
91
  next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
93
92
 
94
93
  @anchors[n["id"]] =
@@ -105,13 +104,12 @@ module IsoDoc::XrefGen
105
104
  "xmlns:example | ./xmlns:example".freeze
106
105
 
107
106
  CHILD_SECTIONS = "./clause | ./appendix | ./terms | ./definitions | "\
108
- "./references"
107
+ "./references".freeze
109
108
 
110
109
  def example_anchor_names(sections)
111
110
  sections.each do |s|
112
- notes = s.xpath(CHILD_EXAMPLES_XPATH)
113
111
  c = Counter.new
114
- notes.each do |n|
112
+ (notes = s.xpath(CHILD_EXAMPLES_XPATH)).each do |n|
115
113
  next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
116
114
 
117
115
  @anchors[n["id"]] =
@@ -145,14 +143,44 @@ module IsoDoc::XrefGen
145
143
  label = "#{prev_label}.#{label}" unless prev_label.empty?
146
144
  label = "#{list_anchor[:xref]} #{label}" if refer_list
147
145
  li["id"] and @anchors[li["id"]] =
148
- { xref: "#{label})", type: "listitem",
149
- container: list_anchor[:container] }
146
+ { xref: "#{label})", type: "listitem",
147
+ container: list_anchor[:container] }
150
148
  li.xpath(ns("./ol")).each do |ol|
151
149
  list_item_anchor_names(ol, list_anchor, depth + 1, label, false)
152
150
  end
153
151
  end
154
152
  end
155
153
 
154
+ def deflist_anchor_names(sections)
155
+ sections.each do |s|
156
+ notes = s.xpath(ns(".//dl")) - s.xpath(ns(".//clause//dl")) -
157
+ s.xpath(ns(".//appendix//dl")) - s.xpath(ns(".//dl//dl"))
158
+ c = Counter.new
159
+ notes.each do |n|
160
+ next if n["id"].nil? || n["id"].empty?
161
+
162
+ @anchors[n["id"]] =
163
+ anchor_struct(increment_label(notes, n, c), n,
164
+ @labels["deflist"], "deflist", false)
165
+ deflist_term_anchor_names(n, @anchors[n["id"]])
166
+ end
167
+ deflist_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
168
+ end
169
+ end
170
+
171
+ def deflist_term_anchor_names(list, list_anchor)
172
+ list.xpath(ns("./dt")).each do |li|
173
+ label = li.text
174
+ label = l10n("#{list_anchor[:xref]}: #{label}")
175
+ li["id"] and @anchors[li["id"]] =
176
+ { xref: label, type: "deflistitem",
177
+ container: list_anchor[:container] }
178
+ li.xpath(ns("./dl")).each do |dl|
179
+ deflist_term_anchor_names(dl, list_anchor)
180
+ end
181
+ end
182
+ end
183
+
156
184
  def bookmark_anchor_names(docxml)
157
185
  docxml.xpath(ns(".//bookmark")).each do |n|
158
186
  next if n["id"].nil? || n["id"].empty?
@@ -139,19 +139,27 @@ RSpec.describe IsoDoc do
139
139
  <preface><foreword>
140
140
  <p>
141
141
  <ul>
142
- <li><concept term='term'>
142
+ <li><concept><refterm>term</refterm>
143
143
  <xref target='clause1'/>
144
144
  </concept></li>
145
- <li><concept term='term'>
146
- <xref target='clause1'>w[o]rd</xref>
145
+ <li><concept><refterm>term</refterm>
146
+ <renderterm>term</renderterm>
147
+ <xref target='clause1'/>
148
+ </concept></li>
149
+ <li><concept><refterm>term</refterm>
150
+ <renderterm>w[o]rd</renderterm>
151
+ <xref target='clause1'>Clause #1</xref>
147
152
  </concept></li>
148
- <li><concept term='term'>
153
+ <li><concept><refterm>term</refterm>
154
+ <renderterm>term</renderterm>
149
155
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
150
156
  </concept></li>
151
- <li><concept term='term'>
152
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712">word</eref>
157
+ <li><concept><refterm>term</refterm>
158
+ <renderterm>word</renderterm>
159
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>
153
160
  </concept></li>
154
- <li><concept>
161
+ <li><concept><refterm>term</refterm>
162
+ <renderterm>word</renderterm>
155
163
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
156
164
  <locality type='clause'>
157
165
  <referenceFrom>3.1</referenceFrom>
@@ -161,7 +169,8 @@ RSpec.describe IsoDoc do
161
169
  </locality>
162
170
  </eref>
163
171
  </concept></li>
164
- <li><concept>
172
+ <li><concept><refterm>term</refterm>
173
+ <renderterm>word</renderterm>
165
174
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
166
175
  <localityStack>
167
176
  <locality type='clause'>
@@ -175,7 +184,8 @@ RSpec.describe IsoDoc do
175
184
  </localityStack>
176
185
  </eref>
177
186
  </concept></li>
178
- <li><concept>
187
+ <li><concept><refterm>term</refterm>
188
+ <renderterm>word</renderterm>
179
189
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
180
190
  <localityStack>
181
191
  <locality type='clause'>
@@ -187,14 +197,16 @@ RSpec.describe IsoDoc do
187
197
  <referenceFrom>b</referenceFrom>
188
198
  </locality>
189
199
  </localityStack>
190
- <em>word</em>
200
+ The Aforementioned Citation
191
201
  </eref>
192
202
  </concept></li>
193
- <li><concept term='term'>
203
+ <li><concept><refterm>term</refterm>
204
+ <renderterm>word</renderterm>
194
205
  <termref base='IEV' target='135-13-13'/>
195
206
  </concept></li>
196
- <li><concept term='term'>
197
- <termref base='IEV' target='135-13-13'><em>word</em> word</termref>
207
+ <li><concept><refterm>term</refterm>
208
+ <renderterm>word</renderterm>
209
+ <termref base='IEV' target='135-13-13'>The IEV database</termref>
198
210
  </concept></li>
199
211
  </ul>
200
212
  </p>
@@ -219,190 +231,166 @@ RSpec.describe IsoDoc do
219
231
  </iso-standard>
220
232
  INPUT
221
233
  presxml = <<~OUTPUT
222
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
223
- <preface>
224
- <foreword displayorder="1">
225
- <p>
226
- <ul>
227
- <li>
228
- <em>
229
- <xref target='clause1'>Clause 2</xref>
230
- </em>
231
- </li>
232
- <li>
233
- <em>
234
- <xref target='clause1'>w[o]rd</xref>
235
- </em>
236
- </li>
237
- <li>
238
- <em>
239
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
240
- </em>
241
- </li>
242
- <li>
243
- <em>
244
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
245
- </em>
246
- </li>
247
- <li>
248
- <em>
249
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
250
- <locality type='clause'>
251
- <referenceFrom>3.1</referenceFrom>
252
- </locality>
253
- <locality type='figure'>
254
- <referenceFrom>a</referenceFrom>
255
- </locality>
256
- ISO 712, Clause 3.1, Figure a
257
- </eref>
258
- </em>
259
- </li>
260
- <li>
261
- <em>
262
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
263
- <localityStack>
264
- <locality type='clause'>
265
- <referenceFrom>3.1</referenceFrom>
266
- </locality>
267
- </localityStack>
268
- <localityStack>
269
- <locality type='figure'>
270
- <referenceFrom>b</referenceFrom>
271
- </locality>
272
- </localityStack>
273
- ISO 712, Clause 3.1; Figure b
274
- </eref>
275
- </em>
276
- </li>
277
- <li>
278
- <em>
279
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
280
- <localityStack>
281
- <locality type='clause'>
282
- <referenceFrom>3.1</referenceFrom>
283
- </locality>
284
- </localityStack>
285
- <localityStack>
286
- <locality type='figure'>
287
- <referenceFrom>b</referenceFrom>
288
- </locality>
289
- </localityStack>
290
- <em>word</em>
291
- </eref>
292
- </em>
293
- </li>
294
- <li>
295
- [term defined in
296
- <termref base='IEV' target='135-13-13'/>
297
- ]
298
- </li>
299
- <li>
300
- <em>
301
- <termref base='IEV' target='135-13-13'>
302
- <em>word</em>
303
- word
304
- </termref>
305
- </em>
306
- </li>
307
- </ul>
308
- </p>
309
- </foreword>
310
- </preface>
311
- <sections>
312
- <clause id='clause1' displayorder="3">
313
- <title depth='1'>
314
- 2.
315
- <tab/>
316
- Clause 1
317
- </title>
318
- </clause>
319
- </sections>
320
- <bibliography>
321
- <references id='_normative_references' obligation='informative' normative='true' displayorder="2">
322
- <title depth='1'>
323
- 1.
324
- <tab/>
325
- Normative References
326
- </title>
327
- <p>
328
- The following documents are referred to in the text in such a way that
329
- some or all of their content constitutes requirements of this document.
330
- For dated references, only the edition cited applies. For undated
331
- references, the latest edition of the referenced document (including any
332
- amendments) applies.
333
- </p>
334
- <bibitem id='ISO712' type='standard'>
335
- <title format='text/plain'>Cereals or cereal products</title>
336
- <title type='main' format='text/plain'>Cereals and cereal products</title>
337
- <docidentifier type='ISO'>ISO 712</docidentifier>
338
- <contributor>
339
- <role type='publisher'/>
340
- <organization>
341
- <name>International Organization for Standardization</name>
342
- </organization>
343
- </contributor>
344
- </bibitem>
345
- </references>
346
- </bibliography>
347
- </iso-standard>
234
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
235
+ <preface><foreword displayorder="1">
236
+ <p>
237
+ <ul>
238
+ <li>
239
+ [term defined in <xref target="clause1">Clause 2</xref>]
240
+ </li>
241
+ <li>
242
+ <em>term</em>
243
+ [term defined in <xref target="clause1">Clause 2</xref>]
244
+ </li>
245
+ <li>
246
+ <em>w[o]rd</em>
247
+ [term defined in <xref target="clause1">Clause #1</xref>]
248
+ </li>
249
+ <li>
250
+ <em>term</em>
251
+ [term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">ISO 712</eref>]
252
+ </li>
253
+ <li>
254
+ <em>word</em>
255
+ [term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>]
256
+ </li>
257
+ <li>
258
+ <em>word</em>
259
+ [term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712"><locality type="clause">
260
+ <referenceFrom>3.1</referenceFrom>
261
+ </locality><locality type="figure">
262
+ <referenceFrom>a</referenceFrom>
263
+ </locality>ISO 712, Clause 3.1, Figure a</eref>]
264
+ </li>
265
+ <li>
266
+ <em>word</em>
267
+ [term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712"><localityStack>
268
+ <locality type="clause">
269
+ <referenceFrom>3.1</referenceFrom>
270
+ </locality>
271
+ </localityStack><localityStack>
272
+ <locality type="figure">
273
+ <referenceFrom>b</referenceFrom>
274
+ </locality>
275
+ </localityStack>ISO 712, Clause 3.1; Figure b</eref>]
276
+ </li>
277
+ <li>
278
+ <em>word</em>
279
+ [term defined in <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
280
+ <localityStack>
281
+ <locality type="clause">
282
+ <referenceFrom>3.1</referenceFrom>
283
+ </locality>
284
+ </localityStack>
285
+ <localityStack>
286
+ <locality type="figure">
287
+ <referenceFrom>b</referenceFrom>
288
+ </locality>
289
+ </localityStack>
290
+ The Aforementioned Citation
291
+ </eref>]
292
+ </li>
293
+ <li>
294
+ <em>word</em>
295
+ [term defined in <termref base="IEV" target="135-13-13"/>]
296
+ </li>
297
+ <li>
298
+ <em>word</em>
299
+ [term defined in <termref base="IEV" target="135-13-13">The IEV database</termref>]
300
+ </li>
301
+ </ul>
302
+ </p>
303
+ </foreword></preface>
304
+ <sections>
305
+ <clause id="clause1" displayorder="3"><title depth="1">2.<tab/>Clause 1</title></clause>
306
+ </sections>
307
+ <bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="2"><title depth="1">1.<tab/>Normative References</title>
308
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
309
+ <bibitem id="ISO712" type="standard">
310
+ <title format="text/plain">Cereals or cereal products</title>
311
+ <title type="main" format="text/plain">Cereals and cereal products</title>
312
+ <docidentifier type="ISO">ISO 712</docidentifier>
313
+ <contributor>
314
+ <role type="publisher"/>
315
+ <organization>
316
+ <name>International Organization for Standardization</name>
317
+ </organization>
318
+ </contributor>
319
+ </bibitem>
320
+ </references></bibliography>
321
+ </iso-standard>
348
322
  OUTPUT
349
323
  output = <<~OUTPUT
350
324
  #{HTML_HDR}
351
- <br/>
325
+ <br/>
352
326
  <div>
353
327
  <h1 class='ForewordTitle'>Foreword</h1>
354
328
  <p>
355
329
  <ul>
356
330
  <li>
357
- <i>
358
- <a href='#clause1'>Clause 2</a>
359
- </i>
331
+ [term defined in
332
+ <a href='#clause1'>Clause 2</a>
333
+ ]
334
+ </li>
335
+ <li>
336
+ <i>term</i>
337
+ [term defined in
338
+ <a href='#clause1'>Clause 2</a>
339
+ ]
340
+ </li>
341
+ <li>
342
+ <i>w[o]rd</i>
343
+ [term defined in
344
+ <a href='#clause1'>Clause #1</a>
345
+ ]
360
346
  </li>
361
347
  <li>
362
- <i>
363
- <a href='#clause1'>w[o]rd</a>
364
- </i>
348
+ <i>term</i>
349
+ [term defined in
350
+ <a href='#ISO712'>ISO 712</a>
351
+ ]
365
352
  </li>
366
353
  <li>
367
- <i>
368
- <a href='#ISO712'>ISO 712</a>
369
- </i>
354
+ <i>word</i>
355
+ [term defined in
356
+ <a href='#ISO712'>The Aforementioned Citation</a>
357
+ ]
370
358
  </li>
371
359
  <li>
372
- <i>
373
- <a href='#ISO712'>word</a>
374
- </i>
360
+ <i>word</i>
361
+ [term defined in
362
+ <a href='#ISO712'>ISO 712, Clause 3.1, Figure a</a>
363
+ ]
375
364
  </li>
376
365
  <li>
377
- <i>
378
- <a href='#ISO712'> ISO 712, Clause 3.1, Figure a </a>
379
- </i>
366
+ <i>word</i>
367
+ [term defined in
368
+ <a href='#ISO712'>ISO 712, Clause 3.1; Figure b</a>
369
+ ]
380
370
  </li>
381
371
  <li>
382
- <i>
383
- <a href='#ISO712'> ISO 712, Clause 3.1; Figure b </a>
384
- </i>
372
+ <i>word</i>
373
+ [term defined in
374
+ <a href='#ISO712'> The Aforementioned Citation </a>
375
+ ]
385
376
  </li>
386
377
  <li>
387
- <i>
388
- <a href='#ISO712'>
389
- <i>word</i>
390
- </a>
391
- </i>
378
+ <i>word</i>
379
+ [term defined in Termbase IEV, term ID 135-13-13]
392
380
  </li>
393
- <li> [term defined in Termbase IEV, term ID 135-13-13 ] </li>
394
381
  <li>
395
- <i> Termbase IEV, term ID 135-13-13 </i>
382
+ <i>word</i>
383
+ [term defined in Termbase IEV, term ID 135-13-13]
396
384
  </li>
397
385
  </ul>
398
386
  </p>
399
387
  </div>
400
388
  <p class='zzSTDTitle1'/>
401
389
  <div>
402
- <h1> 1. &#160; Normative References </h1>
390
+ <h1>1.&#160; Normative References</h1>
403
391
  <p>
404
- The following documents are referred to in the text in such a way
405
- that some or all of their content constitutes requirements of this
392
+ The following documents are referred to in the text in such a way that
393
+ some or all of their content constitutes requirements of this
406
394
  document. For dated references, only the edition cited applies. For
407
395
  undated references, the latest edition of the referenced document
408
396
  (including any amendments) applies.
@@ -413,7 +401,7 @@ RSpec.describe IsoDoc do
413
401
  </p>
414
402
  </div>
415
403
  <div id='clause1'>
416
- <h1> 2. &#160; Clause 1 </h1>
404
+ <h1>2.&#160; Clause 1</h1>
417
405
  </div>
418
406
  </div>
419
407
  </body>