isodoc 1.5.3 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/.rubocop.yml +6 -4
  4. data/Gemfile +2 -2
  5. data/bin/rspec +1 -2
  6. data/isodoc.gemspec +11 -11
  7. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  8. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  9. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  10. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  11. data/lib/isodoc/base_style/all.css +7 -0
  12. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  13. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  14. data/lib/isodoc/base_style/reset.css +7 -0
  15. data/lib/isodoc/base_style/reset.scss +9 -0
  16. data/lib/isodoc/base_style/scripts.html +187 -0
  17. data/lib/isodoc/class_utils.rb +6 -5
  18. data/lib/isodoc/common.rb +2 -0
  19. data/lib/isodoc/convert.rb +30 -17
  20. data/lib/isodoc/css.rb +42 -28
  21. data/lib/isodoc/function/blocks.rb +25 -4
  22. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  23. data/lib/isodoc/function/cleanup.rb +1 -2
  24. data/lib/isodoc/function/form.rb +51 -0
  25. data/lib/isodoc/function/inline.rb +32 -10
  26. data/lib/isodoc/function/references.rb +55 -42
  27. data/lib/isodoc/function/table.rb +1 -0
  28. data/lib/isodoc/function/to_word_html.rb +29 -27
  29. data/lib/isodoc/function/utils.rb +41 -38
  30. data/lib/isodoc/gem_tasks.rb +30 -31
  31. data/lib/isodoc/html_convert.rb +6 -4
  32. data/lib/isodoc/html_function/form.rb +62 -0
  33. data/lib/isodoc/html_function/postprocess.rb +35 -76
  34. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  35. data/lib/isodoc/i18n.rb +33 -31
  36. data/lib/isodoc/pdf_convert.rb +1 -3
  37. data/lib/isodoc/presentation_function/block.rb +26 -11
  38. data/lib/isodoc/presentation_function/inline.rb +60 -111
  39. data/lib/isodoc/presentation_function/math.rb +84 -0
  40. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  41. data/lib/isodoc/version.rb +1 -1
  42. data/lib/isodoc/word_function/body.rb +28 -24
  43. data/lib/isodoc/word_function/footnotes.rb +22 -15
  44. data/lib/isodoc/word_function/inline.rb +6 -0
  45. data/lib/isodoc/word_function/postprocess.rb +16 -6
  46. data/lib/isodoc/xref.rb +10 -11
  47. data/lib/isodoc/xref/xref_counter.rb +31 -15
  48. data/lib/isodoc/xref/xref_gen.rb +28 -22
  49. data/lib/isodoc/xref/xref_sect_gen.rb +22 -20
  50. data/lib/isodoc/xslfo_convert.rb +36 -25
  51. data/spec/assets/html_override.css +1 -0
  52. data/spec/assets/word_override.css +1 -0
  53. data/spec/isodoc/blocks_spec.rb +2599 -2503
  54. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  55. data/spec/isodoc/footnotes_spec.rb +1 -16
  56. data/spec/isodoc/form_spec.rb +156 -0
  57. data/spec/isodoc/i18n_spec.rb +984 -972
  58. data/spec/isodoc/inline_spec.rb +984 -920
  59. data/spec/isodoc/lists_spec.rb +316 -315
  60. data/spec/isodoc/postproc_spec.rb +1692 -1538
  61. data/spec/isodoc/presentation_xml_spec.rb +345 -338
  62. data/spec/isodoc/ref_spec.rb +718 -723
  63. data/spec/isodoc/section_spec.rb +910 -902
  64. data/spec/isodoc/table_spec.rb +566 -556
  65. data/spec/isodoc/terms_spec.rb +252 -256
  66. data/spec/isodoc/xref_spec.rb +3040 -2985
  67. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  68. data/spec/spec_helper.rb +30 -29
  69. metadata +80 -69
  70. data/.rubocop.ribose.yml +0 -65
  71. data/.rubocop.tb.yml +0 -650
@@ -1,777 +1,817 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "droplocs xrefs" do
5
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <sections>
8
- <clause id="A">
9
- <formula id="B">
10
- </formula>
11
- </clause>
12
- <clause id="C">
13
- <p>This is <xref target="A"/> and <xref target="B"/>.
14
- This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
15
- </clause>
16
- </sections>
17
- </iso-standard>
18
- INPUT
19
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
20
- <sections>
21
- <clause id='A'>
22
- <title>1.</title>
23
- <formula id='B'>
24
- <name>1</name>
25
- </formula>
26
- </clause>
27
- <clause id='C'>
28
- <title>2.</title>
29
- <p>
30
- This is
31
- <xref target='A'>kla&#x16D;zo 1</xref>
32
- and
33
- <xref target='B'>kla&#x16D;zo 1, Formula (1)</xref>
34
- . This is
35
- <xref target='A' droploc='true'>1</xref>
36
- and
37
- <xref target='B' droploc='true'>(1)</xref>
38
- .
39
- </p>
40
- </clause>
41
- </sections>
42
- </iso-standard>
43
- OUTPUT
44
- end
4
+ it "droplocs xrefs" do
5
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ i18nyaml: "spec/assets/i18n.yaml" }).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <sections>
8
+ <clause id="A">
9
+ <formula id="B">
10
+ </formula>
11
+ </clause>
12
+ <clause id="C">
13
+ <p>This is <xref target="A"/> and <xref target="B"/>.
14
+ This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
15
+ </clause>
16
+ </sections>
17
+ </iso-standard>
18
+ INPUT
19
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
20
+ <sections>
21
+ <clause id='A'>
22
+ <title>1.</title>
23
+ <formula id='B'>
24
+ <name>1</name>
25
+ </formula>
26
+ </clause>
27
+ <clause id='C'>
28
+ <title>2.</title>
29
+ <p>
30
+ This is
31
+ <xref target='A'>kla&#x16D;zo 1</xref>
32
+ and
33
+ <xref target='B'>kla&#x16D;zo 1, Formula (1)</xref>
34
+ . This is
35
+ <xref target='A' droploc='true'>1</xref>
36
+ and
37
+ <xref target='B' droploc='true'>(1)</xref>
38
+ .
39
+ </p>
40
+ </clause>
41
+ </sections>
42
+ </iso-standard>
43
+ OUTPUT
44
+ end
45
45
 
46
46
  it "processes inline formatting (HTML)" do
47
47
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
48
- <iso-standard xmlns="http://riboseinc.com/isoxml">
49
- <preface><foreword>
50
- <p>
51
- <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
52
- <strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
53
- <bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
54
- </p>
55
- </foreword></preface>
56
- <sections>
57
- </iso-standard>
48
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
49
+ <preface><foreword>
50
+ <p>
51
+ <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
52
+ <strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
53
+ <bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
54
+ </p>
55
+ </foreword></preface>
56
+ <sections>
57
+ </iso-standard>
58
58
  INPUT
59
- #{HTML_HDR}
60
- <br/>
61
- <div>
62
- <h1 class="ForewordTitle">Foreword</h1>
63
- <p>
64
- <i>A</i> <b>B</b> <sup>C</sup> <sub>D</sub> <tt>E</tt>
65
- <s>F</s> <span style="font-variant:small-caps;">G</span> <span class="keyword">I</span> <br/> <hr/>
66
- <a id="H"/> <br/> <br/>
67
- <span style='text-decoration: underline;'>J</span>
68
- </p>
59
+ #{HTML_HDR}
60
+ <br/>
61
+ <div>
62
+ <h1 class="ForewordTitle">Foreword</h1>
63
+ <p>
64
+ <i>A</i> <b>B</b> <sup>C</sup> <sub>D</sub> <tt>E</tt>
65
+ <s>F</s> <span style="font-variant:small-caps;">G</span> <span class="keyword">I</span> <br/> <hr/>
66
+ <a id="H"/> <br/> <br/>
67
+ <span style='text-decoration: underline;'>J</span>
68
+ </p>
69
+ </div>
70
+ <p class="zzSTDTitle1"/>
69
71
  </div>
70
- <p class="zzSTDTitle1"/>
71
- </div>
72
- </body>
73
- </html>
72
+ </body>
73
+ </html>
74
74
  OUTPUT
75
75
  end
76
76
 
77
- it "processes inline formatting (Word)" do
77
+ it "processes inline formatting (Word)" do
78
78
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
79
- <iso-standard xmlns="http://riboseinc.com/isoxml">
80
- <preface/><sections><clause>
81
- <p>
82
- <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
83
- <strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
84
- <bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
85
- </p>
86
- </clause></sections>
87
- </iso-standard>
79
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
80
+ <preface/><sections><clause>
81
+ <p>
82
+ <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
83
+ <strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
84
+ <bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
85
+ </p>
86
+ </clause></sections>
87
+ </iso-standard>
88
88
  INPUT
89
- #{WORD_HDR}
90
- <p class='zzSTDTitle1'/>
91
- <div>
92
- <h1/>
93
- <p>
94
- <i>A</i>
95
- <b>B</b>
96
- <sup>C</sup>
97
- <sub>D</sub>
98
- <tt>E</tt>
99
- <s>F</s>
100
- <span style='font-variant:small-caps;'>G</span>
101
- <span class='keyword'>I</span>
102
- <br/>
103
- <hr/>
104
- <a id='H'/>
105
- <p>
106
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
107
- </p>
108
- <p>
109
- <br clear='all' class='section' orientation='landscape'/>
110
- </p>
111
- <u>J</u>
112
- </p>
113
- </div>
114
- </div>
115
- </body>
116
- </html>
117
-
89
+ #{WORD_HDR}
90
+ <p class='zzSTDTitle1'/>
91
+ <div>
92
+ <h1/>
93
+ <p>
94
+ <i>A</i>
95
+ <b>B</b>
96
+ <sup>C</sup>
97
+ <sub>D</sub>
98
+ <tt>E</tt>
99
+ <s>F</s>
100
+ <span style='font-variant:small-caps;'>G</span>
101
+ <span class='keyword'>I</span>
102
+ <br/>
103
+ <hr/>
104
+ <a id='H'/>
105
+ <p>
106
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
107
+ </p>
108
+ <p>
109
+ <br clear='all' class='section' orientation='landscape'/>
110
+ </p>
111
+ <u>J</u>
112
+ </p>
113
+ </div>
114
+ </div>
115
+ </body>
116
+ </html>
118
117
  OUTPUT
119
118
  end
120
119
 
121
- it "ignores index entries" do
120
+ it "ignores index entries" do
122
121
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
123
- <iso-standard xmlns="http://riboseinc.com/isoxml">
124
- <preface><foreword>
125
- <p><index primary="A" secondary="B" tertiary="C"/></p>
126
- </foreword></preface>
127
- <sections/>
128
- <indexsect>
129
- <title>Index</title>
130
- </indexsect>
131
- </iso-standard>
122
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
123
+ <preface><foreword>
124
+ <p><index primary="A" secondary="B" tertiary="C"/></p>
125
+ </foreword></preface>
126
+ <sections/>
127
+ <indexsect>
128
+ <title>Index</title>
129
+ </indexsect>
130
+ </iso-standard>
132
131
  INPUT
133
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
134
- <preface>
135
- <foreword>
136
- <p/>
137
- </foreword>
138
- </preface>
139
- <sections> </sections>
140
- </iso-standard>
132
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
133
+ <preface>
134
+ <foreword>
135
+ <p/>
136
+ </foreword>
137
+ </preface>
138
+ <sections> </sections>
139
+ </iso-standard>
141
140
  OUTPUT
142
- end
141
+ end
143
142
 
144
- it "processes concept markup" do
145
- input = <<~INPUT
146
- <iso-standard xmlns="http://riboseinc.com/isoxml">
147
- <preface><foreword>
148
- <p>
149
- <ul>
150
- <li><concept term='term'>
151
- <xref target='clause1'/>
152
- </concept></li>
153
- <li><concept term='term'>
154
- <xref target='clause1'>w[o]rd</xref>
155
- </concept></li>
156
- <li><concept term='term'>
157
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
158
- </concept></li>
159
- <li><concept term='term'>
160
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712">word</eref>
161
- </concept></li>
162
- <li><concept>
163
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
164
- <locality type='clause'>
165
- <referenceFrom>3.1</referenceFrom>
166
- </locality>
167
- <locality type='figure'>
168
- <referenceFrom>a</referenceFrom>
169
- </locality>
170
- </eref>
171
- </concept></li>
172
- <li><concept>
173
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
174
- <localityStack>
175
- <locality type='clause'>
176
- <referenceFrom>3.1</referenceFrom>
177
- </locality>
178
- </localityStack>
179
- <localityStack>
180
- <locality type='figure'>
181
- <referenceFrom>b</referenceFrom>
182
- </locality>
183
- </localityStack>
184
- </eref>
185
- </concept></li>
186
- <li><concept>
187
- <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
188
- <localityStack>
189
- <locality type='clause'>
190
- <referenceFrom>3.1</referenceFrom>
191
- </locality>
192
- </localityStack>
193
- <localityStack>
194
- <locality type='figure'>
195
- <referenceFrom>b</referenceFrom>
196
- </locality>
197
- </localityStack>
198
- <em>word</em>
199
- </eref>
200
- </concept></li>
201
- <li><concept term='term'>
202
- <termref base='IEV' target='135-13-13'/>
203
- </concept></li>
204
- <li><concept term='term'>
205
- <termref base='IEV' target='135-13-13'><em>word</em> word</termref>
206
- </concept></li>
207
- </ul>
208
- </p>
209
- </foreword></preface>
210
- <sections>
211
- <clause id="clause1"><title>Clause 1</title></clause>
212
- </sections>
213
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
214
- <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>
215
- <bibitem id="ISO712" type="standard">
216
- <title format="text/plain">Cereals or cereal products</title>
217
- <title type="main" format="text/plain">Cereals and cereal products</title>
218
- <docidentifier type="ISO">ISO 712</docidentifier>
219
- <contributor>
220
- <role type="publisher"/>
221
- <organization>
222
- <name>International Organization for Standardization</name>
223
- </organization>
224
- </contributor>
225
- </bibitem>
226
- </references></bibliography>
227
- </iso-standard>
143
+ it "processes concept markup" do
144
+ input = <<~INPUT
145
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
146
+ <preface><foreword>
147
+ <p>
148
+ <ul>
149
+ <li><concept term='term'>
150
+ <xref target='clause1'/>
151
+ </concept></li>
152
+ <li><concept term='term'>
153
+ <xref target='clause1'>w[o]rd</xref>
154
+ </concept></li>
155
+ <li><concept term='term'>
156
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
157
+ </concept></li>
158
+ <li><concept term='term'>
159
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">word</eref>
160
+ </concept></li>
161
+ <li><concept>
162
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
163
+ <locality type='clause'>
164
+ <referenceFrom>3.1</referenceFrom>
165
+ </locality>
166
+ <locality type='figure'>
167
+ <referenceFrom>a</referenceFrom>
168
+ </locality>
169
+ </eref>
170
+ </concept></li>
171
+ <li><concept>
172
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
173
+ <localityStack>
174
+ <locality type='clause'>
175
+ <referenceFrom>3.1</referenceFrom>
176
+ </locality>
177
+ </localityStack>
178
+ <localityStack>
179
+ <locality type='figure'>
180
+ <referenceFrom>b</referenceFrom>
181
+ </locality>
182
+ </localityStack>
183
+ </eref>
184
+ </concept></li>
185
+ <li><concept>
186
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
187
+ <localityStack>
188
+ <locality type='clause'>
189
+ <referenceFrom>3.1</referenceFrom>
190
+ </locality>
191
+ </localityStack>
192
+ <localityStack>
193
+ <locality type='figure'>
194
+ <referenceFrom>b</referenceFrom>
195
+ </locality>
196
+ </localityStack>
197
+ <em>word</em>
198
+ </eref>
199
+ </concept></li>
200
+ <li><concept term='term'>
201
+ <termref base='IEV' target='135-13-13'/>
202
+ </concept></li>
203
+ <li><concept term='term'>
204
+ <termref base='IEV' target='135-13-13'><em>word</em> word</termref>
205
+ </concept></li>
206
+ </ul>
207
+ </p>
208
+ </foreword></preface>
209
+ <sections>
210
+ <clause id="clause1"><title>Clause 1</title></clause>
211
+ </sections>
212
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
213
+ <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>
214
+ <bibitem id="ISO712" type="standard">
215
+ <title format="text/plain">Cereals or cereal products</title>
216
+ <title type="main" format="text/plain">Cereals and cereal products</title>
217
+ <docidentifier type="ISO">ISO 712</docidentifier>
218
+ <contributor>
219
+ <role type="publisher"/>
220
+ <organization>
221
+ <name>International Organization for Standardization</name>
222
+ </organization>
223
+ </contributor>
224
+ </bibitem>
225
+ </references></bibliography>
226
+ </iso-standard>
228
227
  INPUT
229
228
  presxml = <<~OUTPUT
230
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
231
- <preface>
232
- <foreword>
233
- <p>
234
- <ul>
235
- <li>
236
- <em>
237
- <xref target='clause1'>Clause 2</xref>
238
- </em>
239
- </li>
240
- <li>
241
- <em>
242
- <xref target='clause1'>w[o]rd</xref>
243
- </em>
244
- </li>
245
- <li>
246
- <em>
247
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
248
- </em>
249
- </li>
250
- <li>
251
- <em>
252
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
253
- </em>
254
- </li>
255
- <li>
256
- <em>
257
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
258
- <locality type='clause'>
259
- <referenceFrom>3.1</referenceFrom>
260
- </locality>
261
- <locality type='figure'>
262
- <referenceFrom>a</referenceFrom>
263
- </locality>
264
- ISO 712, Clause 3.1, Figure a
265
- </eref>
266
- </em>
267
- </li>
268
- <li>
269
- <em>
270
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
271
- <localityStack>
272
- <locality type='clause'>
273
- <referenceFrom>3.1</referenceFrom>
274
- </locality>
275
- </localityStack>
276
- <localityStack>
277
- <locality type='figure'>
278
- <referenceFrom>b</referenceFrom>
279
- </locality>
280
- </localityStack>
281
- ISO 712, Clause 3.1; Figure b
282
- </eref>
283
- </em>
284
- </li>
285
- <li>
286
- <em>
287
- <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
288
- <localityStack>
289
- <locality type='clause'>
290
- <referenceFrom>3.1</referenceFrom>
291
- </locality>
292
- </localityStack>
293
- <localityStack>
294
- <locality type='figure'>
295
- <referenceFrom>b</referenceFrom>
296
- </locality>
297
- </localityStack>
298
- <em>word</em>
299
- </eref>
300
- </em>
301
- </li>
302
- <li>
303
- [term defined in
304
- <termref base='IEV' target='135-13-13'/>
305
- ]
306
- </li>
307
- <li>
308
- <em>
309
- <termref base='IEV' target='135-13-13'>
310
- <em>word</em>
311
- word
312
- </termref>
313
- </em>
314
- </li>
315
- </ul>
316
- </p>
317
- </foreword>
318
- </preface>
319
- <sections>
320
- <clause id='clause1'>
321
- <title depth='1'>
322
- 2.
323
- <tab/>
324
- Clause 1
325
- </title>
326
- </clause>
327
- </sections>
328
- <bibliography>
329
- <references id='_normative_references' obligation='informative' normative='true'>
330
- <title depth='1'>
331
- 1.
332
- <tab/>
333
- Normative References
334
- </title>
335
- <p>
336
- The following documents are referred to in the text in such a way that
337
- some or all of their content constitutes requirements of this document.
338
- For dated references, only the edition cited applies. For undated
339
- references, the latest edition of the referenced document (including any
340
- amendments) applies.
341
- </p>
342
- <bibitem id='ISO712' type='standard'>
343
- <title format='text/plain'>Cereals or cereal products</title>
344
- <title type='main' format='text/plain'>Cereals and cereal products</title>
345
- <docidentifier type='ISO'>ISO 712</docidentifier>
346
- <contributor>
347
- <role type='publisher'/>
348
- <organization>
349
- <name>International Organization for Standardization</name>
350
- </organization>
351
- </contributor>
352
- </bibitem>
353
- </references>
354
- </bibliography>
355
- </iso-standard>
356
- end
357
-
358
- it "processes embedded inline formatting" do
359
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
360
- <iso-standard xmlns="http://riboseinc.com/isoxml">
361
- <preface><foreword>
362
- <p>
363
- <em><strong>&lt;</strong></em> <tt><link target="B"/></tt> <xref target="_http_1_1">Requirement <tt>/req/core/http</tt></xref> <eref type="inline" bibitemid="ISO712" citeas="ISO 712">Requirement <tt>/req/core/http</tt></eref>
364
- </p>
365
- </foreword></preface>
366
- <sections>
367
- </iso-standard>
368
- INPUT
369
- #{HTML_HDR}
370
- <br/>
371
- <div>
372
- <h1 class="ForewordTitle">Foreword</h1>
229
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
230
+ <preface>
231
+ <foreword>
373
232
  <p>
374
- <i><b>&lt;</b></i> <tt><a href="B">B</a></tt> <a href="#_http_1_1">Requirement <tt>/req/core/http</tt></a> <a href="#ISO712">Requirement <tt>/req/core/http</tt></a>
375
- </p>
376
- </div>
377
- <p class="zzSTDTitle1"/>
378
- </div>
379
- </body>
380
- </html>
233
+ <ul>
234
+ <li>
235
+ <em>
236
+ <xref target='clause1'>Clause 2</xref>
237
+ </em>
238
+ </li>
239
+ <li>
240
+ <em>
241
+ <xref target='clause1'>w[o]rd</xref>
242
+ </em>
243
+ </li>
244
+ <li>
245
+ <em>
246
+ <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
247
+ </em>
248
+ </li>
249
+ <li>
250
+ <em>
251
+ <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
252
+ </em>
253
+ </li>
254
+ <li>
255
+ <em>
256
+ <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
257
+ <locality type='clause'>
258
+ <referenceFrom>3.1</referenceFrom>
259
+ </locality>
260
+ <locality type='figure'>
261
+ <referenceFrom>a</referenceFrom>
262
+ </locality>
263
+ ISO 712, Clause 3.1, Figure a
264
+ </eref>
265
+ </em>
266
+ </li>
267
+ <li>
268
+ <em>
269
+ <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
270
+ <localityStack>
271
+ <locality type='clause'>
272
+ <referenceFrom>3.1</referenceFrom>
273
+ </locality>
274
+ </localityStack>
275
+ <localityStack>
276
+ <locality type='figure'>
277
+ <referenceFrom>b</referenceFrom>
278
+ </locality>
279
+ </localityStack>
280
+ ISO 712, Clause 3.1; Figure b
281
+ </eref>
282
+ </em>
283
+ </li>
284
+ <li>
285
+ <em>
286
+ <eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
287
+ <localityStack>
288
+ <locality type='clause'>
289
+ <referenceFrom>3.1</referenceFrom>
290
+ </locality>
291
+ </localityStack>
292
+ <localityStack>
293
+ <locality type='figure'>
294
+ <referenceFrom>b</referenceFrom>
295
+ </locality>
296
+ </localityStack>
297
+ <em>word</em>
298
+ </eref>
299
+ </em>
300
+ </li>
301
+ <li>
302
+ [term defined in
303
+ <termref base='IEV' target='135-13-13'/>
304
+ ]
305
+ </li>
306
+ <li>
307
+ <em>
308
+ <termref base='IEV' target='135-13-13'>
309
+ <em>word</em>
310
+ word
311
+ </termref>
312
+ </em>
313
+ </li>
314
+ </ul>
315
+ </p>
316
+ </foreword>
317
+ </preface>
318
+ <sections>
319
+ <clause id='clause1'>
320
+ <title depth='1'>
321
+ 2.
322
+ <tab/>
323
+ Clause 1
324
+ </title>
325
+ </clause>
326
+ </sections>
327
+ <bibliography>
328
+ <references id='_normative_references' obligation='informative' normative='true'>
329
+ <title depth='1'>
330
+ 1.
331
+ <tab/>
332
+ Normative References
333
+ </title>
334
+ <p>
335
+ The following documents are referred to in the text in such a way that
336
+ some or all of their content constitutes requirements of this document.
337
+ For dated references, only the edition cited applies. For undated
338
+ references, the latest edition of the referenced document (including any
339
+ amendments) applies.
340
+ </p>
341
+ <bibitem id='ISO712' type='standard'>
342
+ <title format='text/plain'>Cereals or cereal products</title>
343
+ <title type='main' format='text/plain'>Cereals and cereal products</title>
344
+ <docidentifier type='ISO'>ISO 712</docidentifier>
345
+ <contributor>
346
+ <role type='publisher'/>
347
+ <organization>
348
+ <name>International Organization for Standardization</name>
349
+ </organization>
350
+ </contributor>
351
+ </bibitem>
352
+ </references>
353
+ </bibliography>
354
+ </iso-standard>
355
+ end
356
+
357
+ it "processes embedded inline formatting" do
358
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
359
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
360
+ <preface><foreword>
361
+ <p>
362
+ <em><strong>&lt;</strong></em> <tt><link target="B"/></tt> <xref target="_http_1_1">Requirement <tt>/req/core/http</tt></xref> <eref type="inline" bibitemid="ISO712" citeas="ISO 712">Requirement <tt>/req/core/http</tt></eref>
363
+ </p>
364
+ </foreword></preface>
365
+ <sections>
366
+ </iso-standard>
367
+ INPUT
368
+ #{HTML_HDR}
369
+ <br/>
370
+ <div>
371
+ <h1 class="ForewordTitle">Foreword</h1>
372
+ <p>
373
+ <i><b>&lt;</b></i> <tt><a href="B">B</a></tt> <a href="#_http_1_1">Requirement <tt>/req/core/http</tt></a> <a href="#ISO712">Requirement <tt>/req/core/http</tt></a>
374
+ </p>
375
+ </div>
376
+ <p class="zzSTDTitle1"/>
377
+ </div>
378
+ </body>
379
+ </html>
381
380
  OUTPUT
382
381
  end
383
382
 
384
383
  it "processes inline images" do
385
384
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
386
- <iso-standard xmlns="http://riboseinc.com/isoxml">
387
- <preface><foreword>
388
- <p>
389
- <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
390
- </p>
391
- </foreword></preface>
392
- </iso-standard>
393
- INPUT
394
- #{HTML_HDR}
395
- <br/>
396
- <div>
397
- <h1 class='ForewordTitle'>Foreword</h1>
385
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
386
+ <preface><foreword>
398
387
  <p>
399
- <img src='rice_images/rice_image1.png' height='20' width='30' title='titletxt' alt='alttext'/>
400
- </p>
401
- </div>
402
- <p class='zzSTDTitle1'/>
403
- </div>
404
- </body>
405
- </html>
406
- OUTPUT
388
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
389
+ </p>
390
+ </foreword></preface>
391
+ </iso-standard>
392
+ INPUT
393
+ #{HTML_HDR}
394
+ <br/>
395
+ <div>
396
+ <h1 class='ForewordTitle'>Foreword</h1>
397
+ <p>
398
+ <img src='rice_images/rice_image1.png' height='20' width='30' title='titletxt' alt='alttext'/>
399
+ </p>
400
+ </div>
401
+ <p class='zzSTDTitle1'/>
402
+ </div>
403
+ </body>
404
+ </html>
405
+ OUTPUT
407
406
  end
408
407
 
409
408
  it "processes links" do
410
409
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
411
- <iso-standard xmlns="http://riboseinc.com/isoxml">
412
- <preface><foreword>
413
- <p>
414
- <link target="http://example.com"/>
415
- <link target="http://example.com">example</link>
416
- <link target="http://example.com" alt="tip">example</link>
417
- <link target="mailto:fred@example.com"/>
418
- <link target="mailto:fred@example.com">mailto:fred@example.com</link>
419
- </p>
420
- </foreword></preface>
421
- <sections>
422
- </iso-standard>
410
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
411
+ <preface><foreword>
412
+ <p>
413
+ <link target="http://example.com"/>
414
+ <link target="http://example.com">example</link>
415
+ <link target="http://example.com" alt="tip">example</link>
416
+ <link target="mailto:fred@example.com"/>
417
+ <link target="mailto:fred@example.com">mailto:fred@example.com</link>
418
+ </p>
419
+ </foreword></preface>
420
+ <sections>
421
+ </iso-standard>
423
422
  INPUT
424
- #{HTML_HDR}
425
- <br/>
426
- <div>
427
- <h1 class="ForewordTitle">Foreword</h1>
428
- <p>
429
- <a href="http://example.com">http://example.com</a>
430
- <a href="http://example.com">example</a>
431
- <a href="http://example.com" title="tip">example</a>
432
- <a href="mailto:fred@example.com">fred@example.com</a>
433
- <a href="mailto:fred@example.com">mailto:fred@example.com</a>
434
- </p>
423
+ #{HTML_HDR}
424
+ <br/>
425
+ <div>
426
+ <h1 class="ForewordTitle">Foreword</h1>
427
+ <p>
428
+ <a href="http://example.com">http://example.com</a>
429
+ <a href="http://example.com">example</a>
430
+ <a href="http://example.com" title="tip">example</a>
431
+ <a href="mailto:fred@example.com">fred@example.com</a>
432
+ <a href="mailto:fred@example.com">mailto:fred@example.com</a>
433
+ </p>
434
+ </div>
435
+ <p class="zzSTDTitle1"/>
435
436
  </div>
436
- <p class="zzSTDTitle1"/>
437
- </div>
438
- </body>
439
- </html>
437
+ </body>
438
+ </html>
440
439
  OUTPUT
441
440
  end
442
441
 
443
442
  it "processes unrecognised markup" do
444
443
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
445
- <iso-standard xmlns="http://riboseinc.com/isoxml">
446
- <preface><foreword>
447
- <p>
448
- <barry fred="http://example.com">example</barry>
449
- </p>
450
- </foreword></preface>
451
- <sections>
452
- </iso-standard>
444
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
445
+ <preface><foreword>
446
+ <p>
447
+ <barry fred="http://example.com">example</barry>
448
+ </p>
449
+ </foreword></preface>
450
+ <sections>
451
+ </iso-standard>
453
452
  INPUT
454
- #{HTML_HDR}
455
- <br/>
456
- <div>
457
- <h1 class="ForewordTitle">Foreword</h1>
458
- <p>
459
- <para><b role="strong">&lt;barry fred="http://example.com"&gt;example&lt;/barry&gt;</b></para>
460
- </p>
453
+ #{HTML_HDR}
454
+ <br/>
455
+ <div>
456
+ <h1 class="ForewordTitle">Foreword</h1>
457
+ <p>
458
+ <para><b role="strong">&lt;barry fred="http://example.com"&gt;example&lt;/barry&gt;</b></para>
459
+ </p>
460
+ </div>
461
+ <p class="zzSTDTitle1"/>
461
462
  </div>
462
- <p class="zzSTDTitle1"/>
463
- </div>
464
- </body>
465
- </html>
463
+ </body>
464
+ </html>
466
465
  OUTPUT
467
466
  end
468
467
 
469
468
  it "processes AsciiMath and MathML" do
470
469
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true).sub(/<html/, "<html xmlns:m='m'"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
471
- <iso-standard xmlns="http://riboseinc.com/isoxml">
472
- <preface><foreword>
473
- <p>
474
- <stem type="AsciiMath">&lt;A&gt;</stem>
475
- <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
476
- <stem type="None">Latex?</stem>
477
- </p>
478
- </foreword></preface>
479
- <sections>
480
- </iso-standard>
470
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
471
+ <preface><foreword>
472
+ <p>
473
+ <stem type="AsciiMath">&lt;A&gt;</stem>
474
+ <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
475
+ <stem type="None">Latex?</stem>
476
+ </p>
477
+ </foreword></preface>
478
+ <sections>
479
+ </iso-standard>
481
480
  INPUT
482
- #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
483
- <br/>
484
- <div>
485
- <h1 class="ForewordTitle">Foreword</h1>
486
- <p>
487
- <span class="stem">(#(&lt;A&gt;)#)</span>
488
- <span class="stem"><m:math>
489
- <m:row>X</m:row>
490
- </m:math></span>
491
- <span class="stem">Latex?</span>
492
- </p>
481
+ #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
482
+ <br/>
483
+ <div>
484
+ <h1 class="ForewordTitle">Foreword</h1>
485
+ <p>
486
+ <span class="stem">(#(&lt;A&gt;)#)</span>
487
+ <span class="stem"><m:math>
488
+ <m:row>X</m:row>
489
+ </m:math></span>
490
+ <span class="stem">Latex?</span>
491
+ </p>
492
+ </div>
493
+ <p class="zzSTDTitle1"/>
493
494
  </div>
494
- <p class="zzSTDTitle1"/>
495
- </div>
496
- </body>
497
- </html>
495
+ </body>
496
+ </html>
498
497
  OUTPUT
499
498
  end
500
499
 
501
500
  it "overrides AsciiMath delimiters" do
502
501
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
503
- <iso-standard xmlns="http://riboseinc.com/isoxml">
504
- <preface><foreword>
505
- <p>
506
- <stem type="AsciiMath">A</stem>
507
- (#((Hello))#)
508
- </p>
509
- </foreword></preface>
510
- <sections>
511
- </iso-standard>
502
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
503
+ <preface><foreword>
504
+ <p>
505
+ <stem type="AsciiMath">A</stem>
506
+ (#((Hello))#)
507
+ </p>
508
+ </foreword></preface>
509
+ <sections>
510
+ </iso-standard>
512
511
  INPUT
513
- #{HTML_HDR}
514
- <br/>
515
- <div>
516
- <h1 class="ForewordTitle">Foreword</h1>
517
- <p>
518
- <span class="stem">(#(((A)#)))</span>
519
- (#((Hello))#)
520
- </p>
512
+ #{HTML_HDR}
513
+ <br/>
514
+ <div>
515
+ <h1 class="ForewordTitle">Foreword</h1>
516
+ <p>
517
+ <span class="stem">(#(((A)#)))</span>
518
+ (#((Hello))#)
519
+ </p>
520
+ </div>
521
+ <p class="zzSTDTitle1"/>
521
522
  </div>
522
- <p class="zzSTDTitle1"/>
523
- </div>
524
- </body>
525
- </html>
523
+ </body>
524
+ </html>
526
525
  OUTPUT
527
526
  end
528
527
 
529
528
  it "processes eref types" do
530
529
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
531
- <iso-standard xmlns="http://riboseinc.com/isoxml">
532
- <preface><foreword>
533
- <p>
534
- <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
535
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
536
- </p>
537
- </foreword></preface>
538
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
539
- <bibitem id="ISO712" type="standard">
540
- <title format="text/plain">Cereals and cereal products</title>
541
- <docidentifier>ISO 712</docidentifier>
542
- <contributor>
543
- <role type="publisher"/>
544
- <organization>
545
- <abbreviation>ISO</abbreviation>
546
- </organization>
547
- </contributor>
548
- </bibitem>
549
- </references>
550
- </bibliography>
551
- </iso-standard>
530
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
531
+ <preface><foreword>
532
+ <p>
533
+ <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
534
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
535
+ </p>
536
+ </foreword></preface>
537
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
538
+ <bibitem id="ISO712" type="standard">
539
+ <title format="text/plain">Cereals and cereal products</title>
540
+ <docidentifier>ISO 712</docidentifier>
541
+ <contributor>
542
+ <role type="publisher"/>
543
+ <organization>
544
+ <abbreviation>ISO</abbreviation>
545
+ </organization>
546
+ </contributor>
547
+ </bibitem>
548
+ </references>
549
+ </bibliography>
550
+ </iso-standard>
552
551
  INPUT
553
- #{HTML_HDR}
554
- <br/>
555
- <div>
556
- <h1 class="ForewordTitle">Foreword</h1>
557
- <p>
558
- <sup><a href="#ISO712">A</a></sup>
559
- <a href="#ISO712">A</a>
560
- </p>
561
- </div>
562
- <p class="zzSTDTitle1"/>
563
- <div>
564
- <h1>Normative References</h1>
565
- <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
552
+ #{HTML_HDR}
553
+ <br/>
554
+ <div>
555
+ <h1 class="ForewordTitle">Foreword</h1>
556
+ <p>
557
+ <sup><a href="#ISO712">A</a></sup>
558
+ <a href="#ISO712">A</a>
559
+ </p>
560
+ </div>
561
+ <p class="zzSTDTitle1"/>
562
+ <div>
563
+ <h1>Normative References</h1>
564
+ <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
565
+ </div>
566
566
  </div>
567
- </div>
568
- </body>
569
- </html>
567
+ </body>
568
+ </html>
570
569
  OUTPUT
571
570
  end
572
571
 
573
572
  it "processes eref content" do
574
573
  input = <<~INPUT
575
- <iso-standard xmlns="http://riboseinc.com/isoxml">
576
- <preface><foreword>
577
- <p>
578
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
579
- <eref type="inline" bibitemid="ISO712"/>
580
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
581
- <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
582
- <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
583
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
584
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
585
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
586
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
587
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
588
- <eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
589
- <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
590
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
591
- <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
592
- <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
593
- </p>
594
- </foreword></preface>
595
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
596
- <bibitem id="ISO712" type="standard">
597
- <title format="text/plain">Cereals and cereal products</title>
598
- <docidentifier>ISO 712</docidentifier>
599
- <contributor>
600
- <role type="publisher"/>
601
- <organization>
602
- <abbreviation>ISO</abbreviation>
603
- </organization>
604
- </contributor>
605
- </bibitem>
606
- </references>
607
- </bibliography>
608
- </iso-standard>
574
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
575
+ <preface><foreword>
576
+ <p>
577
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
578
+ <eref type="inline" bibitemid="ISO712"/>
579
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
580
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
581
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
582
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
583
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
584
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
585
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
586
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
587
+ <eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
588
+ <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
589
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
590
+ <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
591
+ <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
592
+ <eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
593
+ <eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
594
+ </p>
595
+ </foreword></preface>
596
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
597
+ <bibitem id="ISO712" type="standard">
598
+ <title format="text/plain">Cereals and cereal products</title>
599
+ <docidentifier>ISO 712</docidentifier>
600
+ <contributor>
601
+ <role type="publisher"/>
602
+ <organization>
603
+ <abbreviation>ISO</abbreviation>
604
+ </organization>
605
+ </contributor>
606
+ </bibitem>
607
+ </references>
608
+ </bibliography>
609
+ </iso-standard>
609
610
  INPUT
610
611
  presxml = <<~OUTPUT
611
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
612
- <preface><foreword>
613
- <p>
614
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
615
- <eref type="inline" bibitemid="ISO712">ISO 712</eref>
616
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Table 1</eref>
617
- <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1</eref>
618
- <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1; Clause 1</eref>
619
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Table 1&#x2013;1</eref>
620
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1, Table 1</eref>
621
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
622
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality>ISO 712, Clause 1.5</eref>
623
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
624
- <eref type="inline" bibitemid="ISO712"><locality type="whole"/>ISO 712, Whole of text</eref>
625
- <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality>ISO 712, Prelude 7</eref>
626
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
627
- <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality>ISO 712</eref>
628
- <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
629
- </p>
630
- </foreword></preface>
631
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title depth='1'>1.<tab/>Normative References</title>
632
- <bibitem id="ISO712" type="standard">
633
- <title format="text/plain">Cereals and cereal products</title>
634
- <docidentifier>ISO 712</docidentifier>
635
- <contributor>
636
- <role type="publisher"/>
637
- <organization>
638
- <abbreviation>ISO</abbreviation>
639
- </organization>
640
- </contributor>
641
- </bibitem>
642
- </references>
643
- </bibliography>
644
- </iso-standard>
645
- OUTPUT
612
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
613
+ <preface><foreword>
614
+ <p>
615
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
616
+ <eref type="inline" bibitemid="ISO712">ISO 712</eref>
617
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Table 1</eref>
618
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1</eref>
619
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1; Clause 1</eref>
620
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Table 1&#x2013;1</eref>
621
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1, Table 1</eref>
622
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
623
+ <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality>ISO 712, Clause 1.5</eref>
624
+ <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
625
+ <eref type="inline" bibitemid="ISO712"><locality type="whole"/>ISO 712, Whole of text</eref>
626
+ <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality>ISO 712, Prelude 7</eref>
627
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
628
+ <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality>ISO 712</eref>
629
+ <eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
630
+ <eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, 1</eref>
631
+ <eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, clause 1</eref>
632
+ </p>
633
+ </foreword></preface>
634
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title depth='1'>1.<tab/>Normative References</title>
635
+ <bibitem id="ISO712" type="standard">
636
+ <title format="text/plain">Cereals and cereal products</title>
637
+ <docidentifier>ISO 712</docidentifier>
638
+ <contributor>
639
+ <role type="publisher"/>
640
+ <organization>
641
+ <abbreviation>ISO</abbreviation>
642
+ </organization>
643
+ </contributor>
644
+ </bibitem>
645
+ </references>
646
+ </bibliography>
647
+ </iso-standard>
648
+ OUTPUT
646
649
 
647
- html = <<~OUTPUT
648
- #{HTML_HDR}
649
- <br/>
650
- <div>
651
- <h1 class="ForewordTitle">Foreword</h1>
652
- <p>
653
- <a href="#ISO712">ISO 712</a>
654
- <a href="#ISO712">ISO 712</a>
655
- <a href="#ISO712">ISO 712, Table 1</a>
656
- <a href='#ISO712'>ISO 712, Table 1</a>
657
- <a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
658
- <a href="#ISO712">ISO 712, Table 1&#8211;1</a>
659
- <a href="#ISO712">ISO 712, Clause 1, Table 1</a>
660
- <a href="#ISO712">ISO 712, Clause 1</a>
661
- <a href="#ISO712">ISO 712, Clause 1.5</a>
662
- <a href="#ISO712">A</a>
663
- <a href="#ISO712">ISO 712, Whole of text</a>
664
- <a href="#ISO712">ISO 712, Prelude 7</a>
665
- <a href="#ISO712">A</a>
666
- <a href='#ISO712'>ISO 712</a>
667
- <a href='#ISO712'>ISO 712, Clause 1</a>
668
- </p>
669
- </div>
670
- <p class="zzSTDTitle1"/>
671
- <div>
672
- <h1>1.&#160; Normative References</h1>
673
- <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
674
- </div>
675
- </div>
676
- </body>
677
- </html>
650
+ html = <<~OUTPUT
651
+ #{HTML_HDR}
652
+ <br/>
653
+ <div>
654
+ <h1 class="ForewordTitle">Foreword</h1>
655
+ <p>
656
+ <a href="#ISO712">ISO 712</a>
657
+ <a href="#ISO712">ISO 712</a>
658
+ <a href="#ISO712">ISO 712, Table 1</a>
659
+ <a href='#ISO712'>ISO 712, Table 1</a>
660
+ <a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
661
+ <a href="#ISO712">ISO 712, Table 1&#8211;1</a>
662
+ <a href="#ISO712">ISO 712, Clause 1, Table 1</a>
663
+ <a href="#ISO712">ISO 712, Clause 1</a>
664
+ <a href="#ISO712">ISO 712, Clause 1.5</a>
665
+ <a href="#ISO712">A</a>
666
+ <a href="#ISO712">ISO 712, Whole of text</a>
667
+ <a href="#ISO712">ISO 712, Prelude 7</a>
668
+ <a href="#ISO712">A</a>
669
+ <a href='#ISO712'>ISO 712</a>
670
+ <a href='#ISO712'>ISO 712, Clause 1</a>
671
+ <a href='#ISO712'>ISO 712, 1</a>
672
+ <a href='#ISO712'>ISO 712, clause 1</a>
673
+ </p>
674
+ </div>
675
+ <p class="zzSTDTitle1"/>
676
+ <div>
677
+ <h1>1.&#160; Normative References</h1>
678
+ <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
679
+ </div>
680
+ </div>
681
+ </body>
682
+ </html>
678
683
  OUTPUT
679
684
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
680
685
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
681
686
  end
682
687
 
683
- it "processes eref content pointing to reference with citation URL" do
684
- input = <<~INPUT
685
- <iso-standard xmlns="http://riboseinc.com/isoxml">
686
- <preface><foreword>
687
- <p>
688
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
689
- <eref type="inline" bibitemid="ISO712"/>
690
- <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
691
- <eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
692
- <eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
693
- <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
694
- <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
695
- <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
696
- <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
697
- <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
698
- <eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
699
- <eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
700
- <eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
701
- <eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
702
- <eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
703
- </p>
704
- </foreword></preface>
705
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
706
- <bibitem id="ISO712" type="standard">
707
- <title format="text/plain">Cereals and cereal products</title>
708
- <uri type="citation">http://www.example.com</uri>
709
- <docidentifier>ISO 712</docidentifier>
710
- <contributor>
711
- <role type="publisher"/>
712
- <organization>
713
- <abbreviation>ISO</abbreviation>
714
- </organization>
715
- </contributor>
716
- </bibitem>
717
- <bibitem id="ISO713" type="standard">
718
- <title format="text/plain">Cereals and cereal products</title>
719
- <uri type="citation">spec/assets/iso713</uri>
720
- <docidentifier>ISO 713</docidentifier>
721
- <contributor>
722
- <role type="publisher"/>
723
- <organization>
724
- <abbreviation>ISO</abbreviation>
725
- </organization>
726
- </contributor>
727
- </bibitem>
728
- </references>
729
- </bibliography>
730
- </iso-standard>
688
+ it "processes eref content pointing to reference with citation URL" do
689
+ input = <<~INPUT
690
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
691
+ <preface><foreword>
692
+ <p>
693
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
694
+ <eref type="inline" bibitemid="ISO712"/>
695
+ <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
696
+ <eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
697
+ <eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
698
+ <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
699
+ <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
700
+ <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
701
+ <eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
702
+ <eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
703
+ <eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
704
+ <eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
705
+ <eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
706
+ <eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
707
+ <eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
708
+ <eref type="inline" bibitemid="ISO714"/>
709
+ </p>
710
+ </foreword></preface>
711
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
712
+ <bibitem id="ISO712" type="standard">
713
+ <title format="text/plain">Cereals and cereal products</title>
714
+ <uri type="citation">http://www.example.com</uri>
715
+ <docidentifier>ISO 712</docidentifier>
716
+ <contributor>
717
+ <role type="publisher"/>
718
+ <organization>
719
+ <abbreviation>ISO</abbreviation>
720
+ </organization>
721
+ </contributor>
722
+ </bibitem>
723
+ <bibitem id="ISO713" type="standard">
724
+ <title format="text/plain">Cereals and cereal products</title>
725
+ <uri type="citation">spec/assets/iso713</uri>
726
+ <docidentifier>ISO 713</docidentifier>
727
+ <contributor>
728
+ <role type="publisher"/>
729
+ <organization>
730
+ <abbreviation>ISO</abbreviation>
731
+ </organization>
732
+ </contributor>
733
+ </bibitem>
734
+ <bibitem id="ISO714" type="standard">
735
+ <title format="text/plain">Cereals and cereal products</title>
736
+ <uri type="citation">spec/assets/iso714.svg</uri>
737
+ <docidentifier>ISO 714</docidentifier>
738
+ <contributor>
739
+ <role type="publisher"/>
740
+ <organization>
741
+ <abbreviation>ISO</abbreviation>
742
+ </organization>
743
+ </contributor>
744
+ </bibitem>
745
+ </references>
746
+ </bibliography>
747
+ </iso-standard>
731
748
  INPUT
732
749
  presxml = <<~OUTPUT
733
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
734
- <preface>
735
- <foreword>
736
- <p>
737
- <eref type='inline' bibitemid='ISO712' citeas='ISO 712'>ISO 712</eref>
738
- <eref type='inline' bibitemid='ISO712'>ISO 712</eref>
739
- <eref type='inline' bibitemid='ISO713'><locality type='table'>
740
- <referenceFrom>1</referenceFrom>
741
- </locality>ISO 713, Table 1</eref>
742
- <eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1</eref>
743
- <eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type='clause'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1; Clause 1</eref>
744
- <eref type='inline' bibitemid='ISO713'><locality type='table'>
745
- <referenceFrom>1</referenceFrom>
746
- <referenceTo>1</referenceTo>
747
- </locality>ISO 713, Table 1&#x2013;1</eref>
748
- <eref type='inline' bibitemid='ISO713'><locality type='clause'><referenceFrom>1</referenceFrom></locality><locality type='table'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1, Table 1</eref>
749
- <eref type='inline' bibitemid='ISO713'><locality type='clause'>
750
- <referenceFrom>1</referenceFrom>
751
- </locality>ISO 713, Clause 1</eref>
752
- <eref type='inline' bibitemid='ISO713'><locality type='clause'>
753
- <referenceFrom>1.5</referenceFrom>
754
- </locality>ISO 713, Clause 1.5</eref>
755
- <eref type='inline' bibitemid='ISO713'><locality type='table'>
756
- <referenceFrom>1</referenceFrom>
757
- </locality>A</eref>
758
- <eref type='inline' bibitemid='ISO713'><locality type='whole'/>ISO 713, Whole of text</eref>
759
- <eref type='inline' bibitemid='ISO713'><locality type='locality:prelude'>
760
- <referenceFrom>7</referenceFrom>
761
- </locality>ISO 713, Prelude 7</eref>
762
- <eref type='inline' bibitemid='ISO713' citeas='ISO 713'>A</eref>
763
- <eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality>ISO 713</eref>
764
- <eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality><locality type='clause'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1</eref>
765
- </p>
766
- </foreword>
767
- </preface>
768
- <bibliography>
769
- <references id='_normative_references' obligation='informative' normative='true'>
770
- <title depth='1'>1.<tab/>Normative References</title>
771
- <bibitem id='ISO712' type='standard'>
750
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
751
+ <preface>
752
+ <foreword>
753
+ <p>
754
+ <eref type='inline' bibitemid='ISO712' citeas='ISO 712'>ISO 712</eref>
755
+ <eref type='inline' bibitemid='ISO712'>ISO 712</eref>
756
+ <eref type='inline' bibitemid='ISO713'><locality type='table'>
757
+ <referenceFrom>1</referenceFrom>
758
+ </locality>ISO 713, Table 1</eref>
759
+ <eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1</eref>
760
+ <eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type='clause'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1; Clause 1</eref>
761
+ <eref type='inline' bibitemid='ISO713'><locality type='table'>
762
+ <referenceFrom>1</referenceFrom>
763
+ <referenceTo>1</referenceTo>
764
+ </locality>ISO 713, Table 1&#x2013;1</eref>
765
+ <eref type='inline' bibitemid='ISO713'><locality type='clause'><referenceFrom>1</referenceFrom></locality><locality type='table'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1, Table 1</eref>
766
+ <eref type='inline' bibitemid='ISO713'><locality type='clause'>
767
+ <referenceFrom>1</referenceFrom>
768
+ </locality>ISO 713, Clause 1</eref>
769
+ <eref type='inline' bibitemid='ISO713'><locality type='clause'>
770
+ <referenceFrom>1.5</referenceFrom>
771
+ </locality>ISO 713, Clause 1.5</eref>
772
+ <eref type='inline' bibitemid='ISO713'><locality type='table'>
773
+ <referenceFrom>1</referenceFrom>
774
+ </locality>A</eref>
775
+ <eref type='inline' bibitemid='ISO713'><locality type='whole'/>ISO 713, Whole of text</eref>
776
+ <eref type='inline' bibitemid='ISO713'><locality type='locality:prelude'>
777
+ <referenceFrom>7</referenceFrom>
778
+ </locality>ISO 713, Prelude 7</eref>
779
+ <eref type='inline' bibitemid='ISO713' citeas='ISO 713'>A</eref>
780
+ <eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality>ISO 713</eref>
781
+ <eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality><locality type='clause'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1</eref>
782
+ <eref type='inline' bibitemid='ISO714'>ISO 714</eref>
783
+ </p>
784
+ </foreword>
785
+ </preface>
786
+ <bibliography>
787
+ <references id='_normative_references' obligation='informative' normative='true'>
788
+ <title depth='1'>1.<tab/>Normative References</title>
789
+ <bibitem id='ISO712' type='standard'>
790
+ <title format='text/plain'>Cereals and cereal products</title>
791
+ <uri type='citation'>http://www.example.com</uri>
792
+ <docidentifier>ISO 712</docidentifier>
793
+ <contributor>
794
+ <role type='publisher'/>
795
+ <organization>
796
+ <abbreviation>ISO</abbreviation>
797
+ </organization>
798
+ </contributor>
799
+ </bibitem>
800
+ <bibitem id='ISO713' type='standard'>
801
+ <title format='text/plain'>Cereals and cereal products</title>
802
+ <uri type='citation'>spec/assets/iso713</uri>
803
+ <docidentifier>ISO 713</docidentifier>
804
+ <contributor>
805
+ <role type='publisher'/>
806
+ <organization>
807
+ <abbreviation>ISO</abbreviation>
808
+ </organization>
809
+ </contributor>
810
+ </bibitem>
811
+ <bibitem id='ISO714' type='standard'>
772
812
  <title format='text/plain'>Cereals and cereal products</title>
773
- <uri type='citation'>http://www.example.com</uri>
774
- <docidentifier>ISO 712</docidentifier>
813
+ <uri type='citation'>spec/assets/iso714.svg</uri>
814
+ <docidentifier>ISO 714</docidentifier>
775
815
  <contributor>
776
816
  <role type='publisher'/>
777
817
  <organization>
@@ -779,242 +819,266 @@ html = <<~OUTPUT
779
819
  </organization>
780
820
  </contributor>
781
821
  </bibitem>
782
- <bibitem id='ISO713' type='standard'>
783
- <title format='text/plain'>Cereals and cereal products</title>
784
- <uri type='citation'>spec/assets/iso713</uri>
785
- <docidentifier>ISO 713</docidentifier>
786
- <contributor>
787
- <role type='publisher'/>
788
- <organization>
789
- <abbreviation>ISO</abbreviation>
790
- </organization>
791
- </contributor>
792
- </bibitem>
793
- </references>
794
- </bibliography>
795
- </iso-standard>
796
- OUTPUT
822
+ </references>
823
+ </bibliography>
824
+ </iso-standard>
825
+ OUTPUT
797
826
 
798
827
  html = <<~OUTPUT
799
- #{HTML_HDR}
800
- <br/>
801
- <div>
802
- <h1 class='ForewordTitle'>Foreword</h1>
803
- <p>
804
- <a href='http://www.example.com'>ISO 712</a>
805
- <a href='http://www.example.com'>ISO 712</a>
806
- <a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
807
- <a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
808
- <a href='spec/assets/iso713.html'>ISO 713, Table 1; Clause 1</a>
809
- <a href='spec/assets/iso713.html'>ISO 713, Table 1&#8211;1</a>
810
- <a href='spec/assets/iso713.html'>ISO 713, Clause 1, Table 1</a>
811
- <a href='spec/assets/iso713.html'>ISO 713, Clause 1</a>
812
- <a href='spec/assets/iso713.html'>ISO 713, Clause 1.5</a>
813
- <a href='spec/assets/iso713.html'>A</a>
814
- <a href='spec/assets/iso713.html'>ISO 713, Whole of text</a>
815
- <a href='spec/assets/iso713.html'>ISO 713, Prelude 7</a>
816
- <a href='spec/assets/iso713.html'>A</a>
817
- <a href='spec/assets/iso713.html#xyz'>ISO 713</a>
818
- <a href='spec/assets/iso713.html#xyz'>ISO 713, Clause 1</a>
819
- </p>
820
- </div>
821
- <p class='zzSTDTitle1'/>
822
- <div>
823
- <h1>1.&#160; Normative References</h1>
824
- <p id='ISO712' class='NormRef'>
825
- ISO 712,
826
- <i>Cereals and cereal products</i>
827
- </p>
828
- <p id='ISO713' class='NormRef'>
829
- ISO 713,
830
- <i>Cereals and cereal products</i>
831
- </p>
832
- </div>
833
- </div>
834
- </body>
835
- </html>
836
- OUTPUT
837
-
838
- word = <<~OUTPUT
839
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
840
- <head>
841
- <style>
842
- </style>
843
- </head>
844
- <body lang='EN-US' link='blue' vlink='#954F72'>
845
- <div class='WordSection1'>
846
- <p>&#160;</p>
847
- </div>
848
- <p>
849
- <br clear='all' class='section'/>
850
- </p>
851
- <div class='WordSection2'>
852
- <p>
853
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
828
+ #{HTML_HDR}
829
+ <br/>
830
+ <div>
831
+ <h1 class='ForewordTitle'>Foreword</h1>
832
+ <p>
833
+ <a href='http://www.example.com'>ISO 712</a>
834
+ <a href='http://www.example.com'>ISO 712</a>
835
+ <a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
836
+ <a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
837
+ <a href='spec/assets/iso713.html'>ISO 713, Table 1; Clause 1</a>
838
+ <a href='spec/assets/iso713.html'>ISO 713, Table 1&#8211;1</a>
839
+ <a href='spec/assets/iso713.html'>ISO 713, Clause 1, Table 1</a>
840
+ <a href='spec/assets/iso713.html'>ISO 713, Clause 1</a>
841
+ <a href='spec/assets/iso713.html'>ISO 713, Clause 1.5</a>
842
+ <a href='spec/assets/iso713.html'>A</a>
843
+ <a href='spec/assets/iso713.html'>ISO 713, Whole of text</a>
844
+ <a href='spec/assets/iso713.html'>ISO 713, Prelude 7</a>
845
+ <a href='spec/assets/iso713.html'>A</a>
846
+ <a href='spec/assets/iso713.html#xyz'>ISO 713</a>
847
+ <a href='spec/assets/iso713.html#xyz'>ISO 713, Clause 1</a>
848
+ <a href='spec/assets/iso714.svg'>ISO 714</a>
849
+ </p>
850
+ </div>
851
+ <p class='zzSTDTitle1'/>
852
+ <div>
853
+ <h1>1.&#160; Normative References</h1>
854
+ <p id='ISO712' class='NormRef'>
855
+ ISO 712,
856
+ <i>Cereals and cereal products</i>
857
+ </p>
858
+ <p id='ISO713' class='NormRef'>
859
+ ISO 713,
860
+ <i>Cereals and cereal products</i>
854
861
  </p>
855
- <div>
856
- <h1 class='ForewordTitle'>Foreword</h1>
857
- <p>
858
- <a href='http://www.example.com'>ISO 712</a>
859
- <a href='http://www.example.com'>ISO 712</a>
860
- <a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
861
- <a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
862
- <a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
863
- <a href='spec/assets/iso713.doc'>ISO 713, Table 1&#8211;1</a>
864
- <a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
865
- <a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
866
- <a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
867
- <a href='spec/assets/iso713.doc'>A</a>
868
- <a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
869
- <a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
870
- <a href='spec/assets/iso713.doc'>A</a>
871
- <a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
872
- <a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
862
+ <p id='ISO714' class='NormRef'>
863
+ ISO 714,
864
+ <i>Cereals and cereal products</i>
873
865
  </p>
874
- </div>
875
- <p>&#160;</p>
876
- </div>
877
- <p>
878
- <br clear='all' class='section'/>
879
- </p>
880
- <div class='WordSection3'>
881
- <p class='zzSTDTitle1'/>
882
- <div>
883
- <h1>
884
- 1.
885
- <span style='mso-tab-count:1'>&#160; </span>
886
- Normative References
887
- </h1>
888
- <p id='ISO712' class='NormRef'>
889
- ISO 712,
890
- <i>Cereals and cereal products</i>
891
- </p>
892
- <p id='ISO713' class='NormRef'>
893
- ISO 713,
894
- <i>Cereals and cereal products</i>
895
- </p>
896
- </div>
897
- </div>
898
- </body>
899
- </html>
866
+ </div>
867
+ </div>
868
+ </body>
869
+ </html>
870
+ OUTPUT
900
871
 
901
- OUTPUT
872
+ word = <<~OUTPUT
873
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
874
+ <head>
875
+ <style>
876
+ </style>
877
+ </head>
878
+ <body lang='EN-US' link='blue' vlink='#954F72'>
879
+ <div class='WordSection1'>
880
+ <p>&#160;</p>
881
+ </div>
882
+ <p>
883
+ <br clear='all' class='section'/>
884
+ </p>
885
+ <div class='WordSection2'>
886
+ <p>
887
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
888
+ </p>
889
+ <div>
890
+ <h1 class='ForewordTitle'>Foreword</h1>
891
+ <p>
892
+ <a href='http://www.example.com'>ISO 712</a>
893
+ <a href='http://www.example.com'>ISO 712</a>
894
+ <a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
895
+ <a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
896
+ <a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
897
+ <a href='spec/assets/iso713.doc'>ISO 713, Table 1&#8211;1</a>
898
+ <a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
899
+ <a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
900
+ <a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
901
+ <a href='spec/assets/iso713.doc'>A</a>
902
+ <a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
903
+ <a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
904
+ <a href='spec/assets/iso713.doc'>A</a>
905
+ <a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
906
+ <a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
907
+ <a href='spec/assets/iso714.svg'>ISO 714</a>
908
+ </p>
909
+ </div>
910
+ <p>&#160;</p>
911
+ </div>
912
+ <p>
913
+ <br clear='all' class='section'/>
914
+ </p>
915
+ <div class='WordSection3'>
916
+ <p class='zzSTDTitle1'/>
917
+ <div>
918
+ <h1>
919
+ 1.
920
+ <span style='mso-tab-count:1'>&#160; </span>
921
+ Normative References
922
+ </h1>
923
+ <p id='ISO712' class='NormRef'>
924
+ ISO 712,
925
+ <i>Cereals and cereal products</i>
926
+ </p>
927
+ <p id='ISO713' class='NormRef'>
928
+ ISO 713,
929
+ <i>Cereals and cereal products</i>
930
+ </p>
931
+ <p id='ISO714' class='NormRef'>
932
+ ISO 714,
933
+ <i>Cereals and cereal products</i>
934
+ </p>
935
+ </div>
936
+ </div>
937
+ </body>
938
+ </html>
939
+ OUTPUT
902
940
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
903
941
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
904
942
  expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
905
- end
943
+ end
906
944
 
907
- it "processes variant" do
908
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
909
- <iso-standard xmlns="http://riboseinc.com/isoxml">
910
- <bibdata>
911
- <language>en</language>
912
- <script>Latn</script>
913
- </bibdata>
914
- <preface>
915
- <clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
916
- <clause id="A1"><title><variant lang="en" script="Grek">ABC</variant><variant lang="fr" script="Grek">DEF</variant></title></clause>
917
- <clause id="A2"><title><variant lang="en">ABC</variant><variant lang="fr">DEF</variant></title></clause>
918
- <clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
919
- <clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
920
- <clause id="C1"><title><variant lang="fr" script="Grek">ABC</variant><variant lang="en" script="Grek">DEF</variant></title></clause>
921
- <clause id="C2"><title><variant lang="fr">ABC</variant><variant lang="en">DEF</variant></title></clause>
922
- <p>A <variant><variant lang="en">B</variant><variant lang="fr">C</variant></variant> D <variant><variant lang="en" script="Latn">E</variant><variant lang="fr" script="Latn">F</variant></variant></p>
923
- </preface>
924
- </iso-standard>
945
+ it "processes variant" do
946
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
947
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
948
+ <bibdata>
949
+ <language>en</language>
950
+ <script>Latn</script>
951
+ </bibdata>
952
+ <preface>
953
+ <clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
954
+ <clause id="A1"><title><variant lang="en" script="Grek">ABC</variant><variant lang="fr" script="Grek">DEF</variant></title></clause>
955
+ <clause id="A2"><title><variant lang="en">ABC</variant><variant lang="fr">DEF</variant></title></clause>
956
+ <clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
957
+ <clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
958
+ <clause id="C1"><title><variant lang="fr" script="Grek">ABC</variant><variant lang="en" script="Grek">DEF</variant></title></clause>
959
+ <clause id="C2"><title><variant lang="fr">ABC</variant><variant lang="en">DEF</variant></title></clause>
960
+ <p>A <variant><variant lang="en">B</variant><variant lang="fr">C</variant></variant> D <variant><variant lang="en" script="Latn">E</variant><variant lang="fr" script="Latn">F</variant></variant></p>
961
+ </preface>
962
+ </iso-standard>
925
963
  INPUT
926
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
927
- <bibdata>
928
- <language current='true'>en</language>
929
- <script current='true'>Latn</script>
930
- </bibdata>
931
- <preface>
932
- <clause id='A'>
933
- <title depth='1'>ABC</title>
934
- </clause>
935
- <clause id='A1'>
936
- <title depth='1'>ABC/DEF</title>
937
- </clause>
938
- <clause id='A2'>
939
- <title depth='1'>ABC</title>
940
- </clause>
941
- <clause id='B'>
942
- <title depth='1'>GHI/JKL</title>
943
- </clause>
944
- <clause id='C'>
945
- <title depth='1'>DEF</title>
946
- </clause>
947
- <clause id='C1'>
948
- <title depth='1'>ABC/DEF</title>
949
- </clause>
950
- <clause id='C2'>
951
- <title depth='1'>DEF</title>
952
- </clause>
953
- <p>A B D E</p>
954
- </preface>
955
- </iso-standard>
964
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
965
+ <bibdata>
966
+ <language current='true'>en</language>
967
+ <script current='true'>Latn</script>
968
+ </bibdata>
969
+ <preface>
970
+ <clause id='A'>
971
+ <title depth='1'>ABC</title>
972
+ </clause>
973
+ <clause id='A1'>
974
+ <title depth='1'>ABC/DEF</title>
975
+ </clause>
976
+ <clause id='A2'>
977
+ <title depth='1'>ABC</title>
978
+ </clause>
979
+ <clause id='B'>
980
+ <title depth='1'>GHI/JKL</title>
981
+ </clause>
982
+ <clause id='C'>
983
+ <title depth='1'>DEF</title>
984
+ </clause>
985
+ <clause id='C1'>
986
+ <title depth='1'>ABC/DEF</title>
987
+ </clause>
988
+ <clause id='C2'>
989
+ <title depth='1'>DEF</title>
990
+ </clause>
991
+ <p>A B D E</p>
992
+ </preface>
993
+ </iso-standard>
956
994
  OUTPUT
957
- end
995
+ end
958
996
 
959
- it "cases xrefs" do
960
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
961
- <iso-standard xmlns="http://riboseinc.com/isoxml">
962
- <sections>
963
- <clause id="A">
964
- <table id="B">
965
- </table>
966
- </clause>
967
- <clause id="C">
968
- <p>This is <xref target="A"/> and <xref target="B"/>.
969
- This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
970
- This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
971
- <xref target="A"/> is clause <em>initial.</em><br/>
972
- <xref target="A"/> is too. </p>
973
- <p><xref target="A"/> is also.</p>
974
- </clause>
975
- </sections>
976
- </iso-standard>
977
- INPUT
978
- <?xml version='1.0'?>
979
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
980
- <sections>
981
- <clause id='A'>
982
- <title>1.</title>
983
- <table id='B'>
984
- <name>Tabelo 1</name>
985
- </table>
986
- </clause>
987
- <clause id='C'>
988
- <title>2.</title>
989
- <p>
990
- This is
991
- <xref target='A'>kla&#x16D;zo 1</xref>
992
- and
993
- <xref target='B'>tabelo 1</xref>
994
- . This is
995
- <xref target='A' case='capital'>Kla&#x16D;zo 1</xref>
996
- and
997
- <xref target='B' case='lowercase'>tabelo 1</xref>
998
- . This is
999
- <xref target='A' case='lowercase'>kla&#x16D;zo 1</xref>
1000
- and
1001
- <xref target='B' case='capital'>Tabelo 1</xref>
1002
- .
1003
- <xref target='A'>Kla&#x16D;zo 1</xref>
1004
- is clause
1005
- <em>initial.</em>
1006
- <br/>
1007
- <xref target='A'>Kla&#x16D;zo 1</xref>
1008
- is too.
1009
- </p>
1010
- <p>
1011
- <xref target='A'>Kla&#x16D;zo 1</xref>
1012
- is also.
1013
- </p>
1014
- </clause>
1015
- </sections>
1016
- </iso-standard>
1017
- OUTPUT
1018
- end
997
+ it "cases xrefs" do
998
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ i18nyaml: "spec/assets/i18n.yaml" }).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
999
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1000
+ <sections>
1001
+ <clause id="A">
1002
+ <table id="B">
1003
+ </table>
1004
+ </clause>
1005
+ <clause id="C">
1006
+ <p>This is <xref target="A"/> and <xref target="B"/>.
1007
+ This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
1008
+ This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
1009
+ <xref target="A"/> is clause <em>initial.</em><br/>
1010
+ <xref target="A"/> is too. </p>
1011
+ <p><xref target="A"/> is also.</p>
1012
+ </clause>
1013
+ </sections>
1014
+ </iso-standard>
1015
+ INPUT
1016
+ <?xml version='1.0'?>
1017
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1018
+ <sections>
1019
+ <clause id='A'>
1020
+ <title>1.</title>
1021
+ <table id='B'>
1022
+ <name>Tabelo 1</name>
1023
+ </table>
1024
+ </clause>
1025
+ <clause id='C'>
1026
+ <title>2.</title>
1027
+ <p>
1028
+ This is
1029
+ <xref target='A'>kla&#x16D;zo 1</xref>
1030
+ and
1031
+ <xref target='B'>tabelo 1</xref>
1032
+ . This is
1033
+ <xref target='A' case='capital'>Kla&#x16D;zo 1</xref>
1034
+ and
1035
+ <xref target='B' case='lowercase'>tabelo 1</xref>
1036
+ . This is
1037
+ <xref target='A' case='lowercase'>kla&#x16D;zo 1</xref>
1038
+ and
1039
+ <xref target='B' case='capital'>Tabelo 1</xref>
1040
+ .
1041
+ <xref target='A'>Kla&#x16D;zo 1</xref>
1042
+ is clause
1043
+ <em>initial.</em>
1044
+ <br/>
1045
+ <xref target='A'>Kla&#x16D;zo 1</xref>
1046
+ is too.
1047
+ </p>
1048
+ <p>
1049
+ <xref target='A'>Kla&#x16D;zo 1</xref>
1050
+ is also.
1051
+ </p>
1052
+ </clause>
1053
+ </sections>
1054
+ </iso-standard>
1055
+ OUTPUT
1056
+ end
1019
1057
 
1058
+ it "processes add, del" do
1059
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1060
+ <itu-standard xmlns="https://www.calconnect.org/standards/itu">
1061
+ <preface><foreword id="A">
1062
+ <add>ABC <xref target="A"></add> <del><strong>B</strong></del>
1063
+ </foreword></preface>
1064
+ </itu-standard>
1065
+ INPUT
1066
+ #{HTML_HDR}
1067
+ <br/>
1068
+ <div id='A'>
1069
+ <h1 class='ForewordTitle'>Foreword</h1>
1070
+ <span class='addition'>
1071
+ ABC
1072
+ <a href='#A'/>
1073
+ <span class='deletion'>
1074
+ <b>B</b>
1075
+ </span>
1076
+ </span>
1077
+ </div>
1078
+ <p class='zzSTDTitle1'/>
1079
+ </div>
1080
+ </body>
1081
+ </html>
1082
+ OUTPUT
1083
+ end
1020
1084
  end