isodoc 0.9.17 → 0.9.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3db2fc3806a2953f1cd51c3edc7a3f8abe930e7a85562f1e3786452a987eb427
4
- data.tar.gz: 92247d33287542fec1bc39186ba8670dd2570e797895a49cfe3257156840099a
3
+ metadata.gz: fc1164b1e3776905b856a609bf053e2825f6885edf53a793ecf2ec9bb961d8c9
4
+ data.tar.gz: 91df81ab9d6ce87fb42b471fe08fca08e790b5372158bca5802380ee1189ec8d
5
5
  SHA512:
6
- metadata.gz: 2a59a21657f9148c4ce184b4429aa1583b096b7ad2925c23be8b0744522efbd74e63aba7d958a9fdcb16ba6bf1d0165ef8e8ffeb059f0406c0068dbdad589188
7
- data.tar.gz: 4c3dcacbc1e711db4618070f17f6b9e8d1b97c72745ed959b620e705fe4eb878a54c3f2ccdf17ff3fea6e3d510e0faf36afa1a7a2d87b2de1c979f3dfc2fee0b
6
+ metadata.gz: f68093afb5788e3d98095cd95afb2ded814f6107f5df39d4036328de31f7dfe91b8f0d49f9286447c516e1ace65cb30b55d39ab532fa614eeb4d82aaba3503bc
7
+ data.tar.gz: a49b38262be2f2c216f5a341d953523b03c83d0894d813d6a3a6fef1be750c558ad9dbb032720074748daf474fcdac226f21017d933282a635d3da10d75911fc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- isodoc (0.9.17)
4
+ isodoc (0.9.18)
5
5
  asciimath
6
6
  html2doc (~> 0.8.6)
7
7
  htmlentities (~> 4.3.4)
@@ -54,14 +54,14 @@ GEM
54
54
  uuidtools
55
55
  htmlentities (4.3.4)
56
56
  image_size (2.0.0)
57
- json (2.1.0)
57
+ json (2.2.0)
58
58
  liquid (4.0.1)
59
59
  listen (3.1.5)
60
60
  rb-fsevent (~> 0.9, >= 0.9.4)
61
61
  rb-inotify (~> 0.9, >= 0.9.7)
62
62
  ruby_dep (~> 1.2)
63
63
  lumberjack (1.0.13)
64
- metanorma (0.3.8)
64
+ metanorma (0.3.9)
65
65
  asciidoctor
66
66
  htmlentities
67
67
  method_source (0.9.2)
@@ -75,7 +75,7 @@ GEM
75
75
  notiffany (0.1.1)
76
76
  nenv (~> 0.1)
77
77
  shellany (~> 0.0)
78
- parallel (1.13.0)
78
+ parallel (1.14.0)
79
79
  parser (2.6.0.0)
80
80
  ast (~> 2.4.0)
81
81
  powerpack (0.1.2)
@@ -128,7 +128,7 @@ GEM
128
128
  thor (0.20.3)
129
129
  thread_safe (0.3.6)
130
130
  timecop (0.9.1)
131
- unicode-display_width (1.4.1)
131
+ unicode-display_width (1.5.0)
132
132
  uuidtools (2.1.5)
133
133
 
134
134
  PLATFORMS
@@ -47,6 +47,9 @@ list: List
47
47
  figure: Figure
48
48
  formula: Formula
49
49
  table: Table
50
+ requirement: Requirement
51
+ recommendation: Recommendation
52
+ permission: Permission
50
53
  key: Key
51
54
  example: EXAMPLE
52
55
  example_xref: Example
@@ -40,6 +40,9 @@ figure: Figure
40
40
  formula: Formule
41
41
  list: Liste
42
42
  table: Tableau
43
+ requirement: Exigence
44
+ recommendation: Recommandation
45
+ permission: Autorisation
43
46
  key: Légende
44
47
  example: EXEMPLE
45
48
  example_xref: Exemple
@@ -40,6 +40,9 @@ figure: 图
40
40
  formula: 公式
41
41
  list: 列项
42
42
  table: 表
43
+ requirement: 要求
44
+ recommendation: 建议
45
+ permission: 容許
43
46
  key: 说明
44
47
  example: 示例
45
48
  example_xref: 示例
@@ -260,5 +260,58 @@ module IsoDoc::Function
260
260
  out.img **attr_code(attrs)
261
261
  image_title_parse(out, caption)
262
262
  end
263
+
264
+ def recommendation_name(node, out, type)
265
+ label = node.at(ns("./label"))
266
+ title = node.at(ns("./title"))
267
+ out.p **{ class: "AdmonitionTitle" } do |b|
268
+ b << l10n("#{type} #{get_anchors[node['id']][:label]}:")
269
+ if label || title
270
+ b.br
271
+ label and label.children.each { |n| parse(n,b) }
272
+ b << "#{clausedelim} " if label && title
273
+ title and title.children.each { |n| parse(n,b) }
274
+ end
275
+ end
276
+ end
277
+
278
+ def recommendation_parse(node, out)
279
+ out.div **{ class: "recommend" } do |t|
280
+ recommendation_name(node, t, @recommendation_lbl)
281
+ node.children.each do |n|
282
+ parse(n, t) unless %w(label title).include? n.name
283
+ end
284
+ end
285
+ end
286
+
287
+ def requirement_parse(node, out)
288
+ out.div **{ class: "require" } do |t|
289
+ recommendation_name(node, t, @requirement_lbl)
290
+ node.children.each do |n|
291
+ parse(n, t) unless %w(label title).include? n.name
292
+ end
293
+ end
294
+ end
295
+
296
+ def permission_parse(node, out)
297
+ out.div **{ class: "permission" } do |t|
298
+ recommendation_name(node, t, @permission_lbl)
299
+ node.children.each do |n|
300
+ parse(n, t) unless %w(label title).include? n.name
301
+ end
302
+ end
303
+ end
304
+
305
+ def requirement_component_parse(node, out)
306
+ return if node["exclude"] == "true"
307
+ out.div do |div|
308
+ node.children.each do |n|
309
+ parse(n, div)
310
+ end
311
+ end
312
+ end
313
+
314
+ def requirement_skip_parse(node, out)
315
+ end
263
316
  end
264
317
  end
@@ -65,6 +65,9 @@ module IsoDoc::Function
65
65
  @source_lbl = y["source"]
66
66
  @and_lbl = y["and"]
67
67
  @all_parts_lbl = y["all_parts"]
68
+ @permission_lbl = y["permission"]
69
+ @recommendation_lbl = y["recommendation"]
70
+ @requirement_lbl = y["requirement"]
68
71
  @locality = y["locality"]
69
72
  @admonition = y["admonition"]
70
73
  @labels = y
@@ -1,11 +1,15 @@
1
1
  module IsoDoc::Function
2
2
  module Section
3
+ def clausedelim
4
+ "."
5
+ end
6
+
3
7
  def inline_header_title(out, node, c1)
4
8
  title = c1&.content || ""
5
9
  out.span **{ class: "zzMoveToFollowing" } do |s|
6
10
  s.b do |b|
7
11
  if get_anchors[node['id']][:label] && !@suppressheadingnumbers
8
- b << "#{get_anchors[node['id']][:label]}. "
12
+ b << "#{get_anchors[node['id']][:label]}#{clausedelim} "
9
13
  end
10
14
  b << "#{title} "
11
15
  end
@@ -18,7 +22,7 @@ module IsoDoc::Function
18
22
  else
19
23
  div.send "h#{get_anchors[node['id']][:level]}" do |h|
20
24
  lbl = get_anchors[node['id']][:label]
21
- h << "#{lbl}. " if lbl && !@suppressheadingnumbers
25
+ h << "#{lbl}#{clausedelim} " if lbl && !@suppressheadingnumbers
22
26
  c1&.children&.each { |c2| parse(c2, h) }
23
27
  end
24
28
  end
@@ -37,7 +41,7 @@ module IsoDoc::Function
37
41
  header_class = {} if header_class.nil?
38
42
  div.h1 **attr_code(header_class) do |h1|
39
43
  if num && !@suppressheadingnumbers
40
- h1 << "#{num}."
44
+ h1 << "#{num}#{clausedelim}"
41
45
  insert_tab(h1, 1)
42
46
  end
43
47
  h1 << title
@@ -60,7 +60,7 @@ module IsoDoc::Function
60
60
 
61
61
  def termdef_parse(node, out)
62
62
  out.p **{ class: "TermNum", id: node["id"] } do |p|
63
- p << get_anchors[node["id"]][:label]
63
+ p << "#{get_anchors[node["id"]][:label]}#{clausedelim}"
64
64
  end
65
65
  set_termdomain("")
66
66
  node.children.each { |n| parse(n, out) }
@@ -235,6 +235,16 @@ module IsoDoc::Function
235
235
  when "definitions" then symbols_parse(node, out)
236
236
  when "references" then bibliography_parse(node, out)
237
237
  when "termdocsource" then termdocsource_parse(node, out)
238
+ when "requirement" then requirement_parse(node, out)
239
+ when "recommendation" then recommendation_parse(node, out)
240
+ when "permission" then permission_parse(node, out)
241
+ when "subject" then requirement_skip_parse(node, out)
242
+ when "inherit" then requirement_component_parse(node, out)
243
+ when "description" then requirement_component_parse(node, out)
244
+ when "specification" then requirement_component_parse(node, out)
245
+ when "measurement-target" then requirement_component_parse(node, out)
246
+ when "verification" then requirement_component_parse(node, out)
247
+ when "import" then requirement_component_parse(node, out)
238
248
  else
239
249
  error_parse(node, out)
240
250
  end
@@ -173,18 +173,51 @@ module IsoDoc::Function
173
173
  ret
174
174
  end
175
175
 
176
- def sequential_asset_names(clause)
176
+ def sequential_table_names(clause)
177
177
  clause.xpath(ns(".//table")).each_with_index do |t, i|
178
178
  next if t["id"].nil? || t["id"].empty?
179
179
  @anchors[t["id"]] = anchor_struct(i + 1, nil, @table_lbl, "table")
180
180
  end
181
- sequential_figure_names(clause)
181
+ end
182
+
183
+ def sequential_formula_names(clause)
182
184
  clause.xpath(ns(".//formula")).each_with_index do |t, i|
183
185
  next if t["id"].nil? || t["id"].empty?
184
186
  @anchors[t["id"]] = anchor_struct(i + 1, t, @formula_lbl, "formula")
185
187
  end
186
188
  end
187
189
 
190
+ def sequential_permission_names(clause)
191
+ clause.xpath(ns(".//permission")).each_with_index do |t, i|
192
+ next if t["id"].nil? || t["id"].empty?
193
+ @anchors[t["id"]] = anchor_struct(i + 1, t, @permission_lbl, "permission")
194
+ end
195
+ end
196
+
197
+ def sequential_requirement_names(clause)
198
+ clause.xpath(ns(".//requirement")).each_with_index do |t, i|
199
+ next if t["id"].nil? || t["id"].empty?
200
+ @anchors[t["id"]] = anchor_struct(i + 1, t, @requirement_lbl, "requirement")
201
+ end
202
+ end
203
+
204
+ def sequential_recommendation_names(clause)
205
+ clause.xpath(ns(".//recommendation")).each_with_index do |t, i|
206
+ next if t["id"].nil? || t["id"].empty?
207
+ @anchors[t["id"]] = anchor_struct(i + 1, t, @recommendation_lbl, "recommendation")
208
+ end
209
+ end
210
+
211
+
212
+ def sequential_asset_names(clause)
213
+ sequential_table_names(clause)
214
+ sequential_figure_names(clause)
215
+ sequential_formula_names(clause)
216
+ sequential_permission_names(clause)
217
+ sequential_requirement_names(clause)
218
+ sequential_recommendation_names(clause)
219
+ end
220
+
188
221
  def hiersep
189
222
  "."
190
223
  end
@@ -219,6 +252,9 @@ module IsoDoc::Function
219
252
  hierarchical_table_names(clause, num)
220
253
  hierarchical_figure_names(clause, num)
221
254
  hierarchical_formula_names(clause, num)
255
+ hierarchical_permission_names(clause, num)
256
+ hierarchical_requirement_names(clause, num)
257
+ hierarchical_recommendation_names(clause, num)
222
258
  end
223
259
 
224
260
  def hierarchical_formula_names(clause, num)
@@ -228,5 +264,29 @@ module IsoDoc::Function
228
264
  t, @formula_lbl, "formula")
229
265
  end
230
266
  end
267
+
268
+ def hierarchical_permission_names(clause, num)
269
+ clause.xpath(ns(".//permission")).each_with_index do |t, i|
270
+ next if t["id"].nil? || t["id"].empty?
271
+ @anchors[t["id"]] = anchor_struct("#{num}.#{i + 1}",
272
+ t, @permission_lbl, "permission")
273
+ end
274
+ end
275
+
276
+ def hierarchical_requirement_names(clause, num)
277
+ clause.xpath(ns(".//requirement")).each_with_index do |t, i|
278
+ next if t["id"].nil? || t["id"].empty?
279
+ @anchors[t["id"]] = anchor_struct("#{num}.#{i + 1}",
280
+ t, @requirement_lbl, "requirement")
281
+ end
282
+ end
283
+
284
+ def hierarchical_recommendation_names(clause, num)
285
+ clause.xpath(ns(".//recommendation")).each_with_index do |t, i|
286
+ next if t["id"].nil? || t["id"].empty?
287
+ @anchors[t["id"]] = anchor_struct("#{num}.#{i + 1}",
288
+ t, @recommendation_lbl, "recommendation")
289
+ end
290
+ end
231
291
  end
232
292
  end
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.9.17".freeze
2
+ VERSION = "0.9.18".freeze
3
3
  end
@@ -733,7 +733,7 @@ World</p>
733
733
  <li> <p>IEC Electropedia: available at
734
734
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
735
735
  </p> </li> </ul>
736
- <p class="TermNum" id="_extraneous_matter">1.1</p><p class="Terms" style="text-align:left;">extraneous matter</p><p class="AltTerms" style="text-align:left;">EM</p>
736
+ <p class="TermNum" id="_extraneous_matter">1.1.</p><p class="Terms" style="text-align:left;">extraneous matter</p><p class="AltTerms" style="text-align:left;">EM</p>
737
737
 
738
738
  <p id="_318b3939-be09-46c4-a284-93f9826b981e">&lt;rice&gt; organic and inorganic components other than whole or broken kernels</p>
739
739
  </div>
@@ -743,5 +743,258 @@ World</p>
743
743
  OUTPUT
744
744
  end
745
745
 
746
+ it "processes permissions" do
747
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
748
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
749
+ <preface><foreword>
750
+ <permission id="_">
751
+ <label>/ogc/recommendation/wfs/2</label>
752
+ <inherit>/ss/584/2015/level/1</inherit>
753
+ <subject>user</subject>
754
+ <description>
755
+ <p id="_">I recommend <em>this</em>.</p>
756
+ </description>
757
+ <specification exclude="true" type="tabular">
758
+ <p id="_">This is the object of the recommendation:</p>
759
+ <table id="_">
760
+ <tbody>
761
+ <tr>
762
+ <td align="left">Object</td>
763
+ <td align="left">Value</td>
764
+ </tr>
765
+ <tr>
766
+ <td align="left">Mission</td>
767
+ <td align="left">Accomplished</td>
768
+ </tr>
769
+ </tbody>
770
+ </table>
771
+ </specification>
772
+ <description>
773
+ <p id="_">As for the measurement targets,</p>
774
+ </description>
775
+ <measurement-target exclude="false">
776
+ <p id="_">The measurement target shall be measured as:</p>
777
+ <formula id="_">
778
+ <stem type="AsciiMath">r/1 = 0</stem>
779
+ </formula>
780
+ </measurement-target>
781
+ <verification exclude="false">
782
+ <p id="_">The following code will be run for verification:</p>
783
+ <sourcecode id="_">CoreRoot(success): HttpResponse
784
+ if (success)
785
+ recommendation(label: success-response)
786
+ end
787
+ </sourcecode>
788
+ </verification>
789
+ <import exclude="true">
790
+ <sourcecode id="_">success-response()</sourcecode>
791
+ </import>
792
+ </permission>
793
+ </foreword></preface>
794
+ </iso-standard>
795
+ INPUT
796
+ #{HTML_HDR}
797
+ <br/>
798
+ <div>
799
+ <h1 class="ForewordTitle">Foreword</h1>
800
+ <div class="permission"><p class="AdmonitionTitle">Permission 1:<br/>/ogc/recommendation/wfs/2</p>
801
+
802
+ <div>/ss/584/2015/level/1</div>
803
+ <div>
804
+ <p id="_">I recommend <i>this</i>.</p>
805
+ </div>
806
+
807
+ <div>
808
+ <p id="_">As for the measurement targets,</p>
809
+ </div>
810
+ <div>
811
+ <p id="_">The measurement target shall be measured as:</p>
812
+ <div id="_" class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div>
813
+
814
+
815
+ </div>
816
+ <div>
817
+ <p id="_">The following code will be run for verification:</p>
818
+ <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
819
+ </div>
820
+
821
+ </div>
822
+ </div>
823
+ <p class="zzSTDTitle1"/>
824
+ </div>
825
+ </body>
826
+ </html>
827
+ OUTPUT
828
+ end
829
+
830
+ it "processes requirements" do
831
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
832
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
833
+ <preface><foreword>
834
+ <requirement id="_">
835
+ <title>A New Requirement</title>
836
+ <label>/ogc/recommendation/wfs/2</label>
837
+ <inherit>/ss/584/2015/level/1</inherit>
838
+ <subject>user</subject>
839
+ <description>
840
+ <p id="_">I recommend <em>this</em>.</p>
841
+ </description>
842
+ <specification exclude="true" type="tabular">
843
+ <p id="_">This is the object of the recommendation:</p>
844
+ <table id="_">
845
+ <tbody>
846
+ <tr>
847
+ <td align="left">Object</td>
848
+ <td align="left">Value</td>
849
+ </tr>
850
+ <tr>
851
+ <td align="left">Mission</td>
852
+ <td align="left">Accomplished</td>
853
+ </tr>
854
+ </tbody>
855
+ </table>
856
+ </specification>
857
+ <description>
858
+ <p id="_">As for the measurement targets,</p>
859
+ </description>
860
+ <measurement-target exclude="false">
861
+ <p id="_">The measurement target shall be measured as:</p>
862
+ <formula id="_">
863
+ <stem type="AsciiMath">r/1 = 0</stem>
864
+ </formula>
865
+ </measurement-target>
866
+ <verification exclude="false">
867
+ <p id="_">The following code will be run for verification:</p>
868
+ <sourcecode id="_">CoreRoot(success): HttpResponse
869
+ if (success)
870
+ recommendation(label: success-response)
871
+ end
872
+ </sourcecode>
873
+ </verification>
874
+ <import exclude="true">
875
+ <sourcecode id="_">success-response()</sourcecode>
876
+ </import>
877
+ </requirement>
878
+ </foreword></preface>
879
+ </iso-standard>
880
+ INPUT
881
+ #{HTML_HDR}
882
+ <br/>
883
+ <div>
884
+ <h1 class="ForewordTitle">Foreword</h1>
885
+ <div class="require"><p class="AdmonitionTitle">Requirement 1:<br/>/ogc/recommendation/wfs/2. A New Requirement</p>
886
+
887
+ <div>/ss/584/2015/level/1</div>
888
+ <div>
889
+ <p id="_">I recommend <i>this</i>.</p>
890
+ </div>
891
+
892
+ <div>
893
+ <p id="_">As for the measurement targets,</p>
894
+ </div>
895
+ <div>
896
+ <p id="_">The measurement target shall be measured as:</p>
897
+ <div id="_" class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div>
898
+
899
+
900
+ </div>
901
+ <div>
902
+ <p id="_">The following code will be run for verification:</p>
903
+ <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
904
+ </div>
905
+
906
+ </div>
907
+ </div>
908
+ <p class="zzSTDTitle1"/>
909
+ </div>
910
+ </body>
911
+ </html>
912
+ OUTPUT
913
+ end
914
+
915
+ it "processes recommendation" do
916
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
917
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
918
+ <preface><foreword>
919
+ <recommendation id="_">
920
+ <label>/ogc/recommendation/wfs/2</label>
921
+ <inherit>/ss/584/2015/level/1</inherit>
922
+ <subject>user</subject>
923
+ <description>
924
+ <p id="_">I recommend <em>this</em>.</p>
925
+ </description>
926
+ <specification exclude="true" type="tabular">
927
+ <p id="_">This is the object of the recommendation:</p>
928
+ <table id="_">
929
+ <tbody>
930
+ <tr>
931
+ <td align="left">Object</td>
932
+ <td align="left">Value</td>
933
+ </tr>
934
+ <tr>
935
+ <td align="left">Mission</td>
936
+ <td align="left">Accomplished</td>
937
+ </tr>
938
+ </tbody>
939
+ </table>
940
+ </specification>
941
+ <description>
942
+ <p id="_">As for the measurement targets,</p>
943
+ </description>
944
+ <measurement-target exclude="false">
945
+ <p id="_">The measurement target shall be measured as:</p>
946
+ <formula id="_">
947
+ <stem type="AsciiMath">r/1 = 0</stem>
948
+ </formula>
949
+ </measurement-target>
950
+ <verification exclude="false">
951
+ <p id="_">The following code will be run for verification:</p>
952
+ <sourcecode id="_">CoreRoot(success): HttpResponse
953
+ if (success)
954
+ recommendation(label: success-response)
955
+ end
956
+ </sourcecode>
957
+ </verification>
958
+ <import exclude="true">
959
+ <sourcecode id="_">success-response()</sourcecode>
960
+ </import>
961
+ </recommendation>
962
+ </foreword></preface>
963
+ </iso-standard>
964
+ INPUT
965
+ #{HTML_HDR}
966
+ <br/>
967
+ <div>
968
+ <h1 class="ForewordTitle">Foreword</h1>
969
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 1:<br/>/ogc/recommendation/wfs/2</p>
970
+
971
+ <div>/ss/584/2015/level/1</div>
972
+ <div>
973
+ <p id="_">I recommend <i>this</i>.</p>
974
+ </div>
975
+
976
+ <div>
977
+ <p id="_">As for the measurement targets,</p>
978
+ </div>
979
+ <div>
980
+ <p id="_">The measurement target shall be measured as:</p>
981
+ <div id="_" class="formula"><p><span class="stem">(#(r/1 = 0)#)</span>&#160; (1)</p></div>
982
+
983
+
984
+ </div>
985
+ <div>
986
+ <p id="_">The following code will be run for verification:</p>
987
+ <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
988
+ </div>
989
+
990
+ </div>
991
+ </div>
992
+ <p class="zzSTDTitle1"/>
993
+ </div>
994
+ </body>
995
+ </html>
996
+ OUTPUT
997
+ end
998
+
746
999
 
747
1000
  end
@@ -101,7 +101,7 @@ RSpec.describe IsoDoc do
101
101
  </p> </li> </ul>
102
102
  <div id="I">
103
103
  <h2>3.1. Normal Terms</h2>
104
- <p class="TermNum" id="J">3.1.1</p>
104
+ <p class="TermNum" id="J">3.1.1.</p>
105
105
  <p class="Terms" style="text-align:left;">Term2</p>
106
106
 
107
107
  </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
@@ -248,7 +248,7 @@ RSpec.describe IsoDoc do
248
248
  </p> </li> </ul>
249
249
  <div id="I">
250
250
  <h2>3.1. Normal Terms</h2>
251
- <p class="TermNum" id="J">3.1.1</p>
251
+ <p class="TermNum" id="J">3.1.1.</p>
252
252
  <p class="Terms" style="text-align:left;">Term2</p>
253
253
 
254
254
  </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
@@ -394,7 +394,7 @@ RSpec.describe IsoDoc do
394
394
  </p> </li> </ul>
395
395
  <div id="I">
396
396
  <h2>3.1. Normal Terms</h2>
397
- <p class="TermNum" id="J">3.1.1</p>
397
+ <p class="TermNum" id="J">3.1.1.</p>
398
398
  <p class="Terms" style="text-align:left;">Term2</p>
399
399
 
400
400
  </div><div id="K"><h2>3.2. Symboles et termes abr&#233;g&#233;s</h2>
@@ -552,7 +552,7 @@ RSpec.describe IsoDoc do
552
552
  </p> </li> </ul>
553
553
  <div id="I">
554
554
  <h2>3.1. Normal Terms</h2>
555
- <p class="TermNum" id="J">3.1.1</p>
555
+ <p class="TermNum" id="J">3.1.1.</p>
556
556
  <p class="Terms" style="text-align:left;">Term2</p>
557
557
 
558
558
  </div><div id="K"><h2>3.2. &#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h2>
@@ -300,7 +300,7 @@ RSpec.describe IsoDoc do
300
300
 
301
301
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
302
302
  </p>
303
- <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
303
+ <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
304
304
  <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
305
305
  <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified &mdash; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
306
306
  </div>
@@ -621,8 +621,8 @@ ICAgICAgIDogRU5EIERPQyBJRAoKRklMRU5BTUU6IHRlc3QKCg==
621
621
  INPUT
622
622
  expect(File.exist?("test.html")).to be true
623
623
  html = File.read("test.html")
624
- expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1</h2>})
625
- expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
624
+ expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1\.</h2>})
625
+ expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2\.</h2>})
626
626
  end
627
627
 
628
628
  it "creates continuation styles for multiparagraph list items in Word" do
@@ -136,7 +136,7 @@ RSpec.describe IsoDoc do
136
136
  </p> </li> </ul>
137
137
  <div id="I">
138
138
  <h2>3.1. Normal Terms</h2>
139
- <p class="TermNum" id="J">3.1.1</p>
139
+ <p class="TermNum" id="J">3.1.1.</p>
140
140
  <p class="Terms" style="text-align:left;">Term2</p>
141
141
 
142
142
  </div><div id="K"><h2>3.2. Definitions</h2>
@@ -305,7 +305,7 @@ OUTPUT
305
305
  </p> </li> </ul>
306
306
  <div id="I">
307
307
  <h2>3.1. Normal Terms</h2>
308
- <p class="TermNum" id="J">3.1.1</p>
308
+ <p class="TermNum" id="J">3.1.1.</p>
309
309
  <p class="Terms" style="text-align:left;">Term2</p>
310
310
 
311
311
  </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
@@ -457,7 +457,7 @@ OUTPUT
457
457
  </p> </li> </ul>
458
458
  <div id="I"><h2>Normal Terms</h2>
459
459
 
460
- <p class="TermNum" id="J">3.1.1</p>
460
+ <p class="TermNum" id="J">3.1.1.</p>
461
461
  <p class="Terms" style="text-align:left;">Term2</p>
462
462
 
463
463
  </div><div id="K"><h2>Symbols and abbreviated terms</h2>
@@ -531,7 +531,7 @@ OUTPUT
531
531
  <li> <p>IEC Electropedia: available at
532
532
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
533
533
  </p> </li> </ul>
534
- <p class="TermNum" id="J">1.1</p>
534
+ <p class="TermNum" id="J">1.1.</p>
535
535
  <p class="Terms" style="text-align:left;">Term2</p>
536
536
  </div>
537
537
  </div>
@@ -599,7 +599,7 @@ end
599
599
  <li> <p>IEC Electropedia: available at
600
600
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
601
601
  </p> </li> </ul>
602
- <p class="TermNum" id="J">2.1</p>
602
+ <p class="TermNum" id="J">2.1.</p>
603
603
  <p class="Terms" style="text-align:left;">Term2</p>
604
604
  </div>
605
605
  </div>
@@ -65,7 +65,7 @@ RSpec.describe IsoDoc do
65
65
  <li> <p>IEC Electropedia: available at
66
66
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
67
67
  </p> </li> </ul>
68
- <p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
68
+ <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
69
69
 
70
70
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
71
71
  <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
@@ -83,7 +83,7 @@ RSpec.describe IsoDoc do
83
83
  <p>[TERMREF]
84
84
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
85
85
  [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
86
- [/TERMREF]</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
86
+ [/TERMREF]</p><p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
87
87
  <p class="AltTerms" style="text-align:left;">rough rice</p>
88
88
  <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
89
89
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
@@ -168,7 +168,7 @@ OUTPUT
168
168
  <li> <p>IEC Electropedia: available at
169
169
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
170
170
  </p> </li> </ul>
171
- <p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
171
+ <p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
172
172
 
173
173
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
174
174
  <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
@@ -186,7 +186,7 @@ OUTPUT
186
186
  <p>[TERMREF]
187
187
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
188
188
  [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
189
- [/TERMREF]</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
189
+ [/TERMREF]</p><p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
190
190
  <p class="AltTerms" style="text-align:left;">rough rice</p>
191
191
  <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
192
192
  <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
@@ -680,20 +680,6 @@ RSpec.describe IsoDoc do
680
680
  </clause>
681
681
  </annex>
682
682
  </iso-standard>
683
-
684
- <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934">
685
- <stem type="AsciiMath">r = 1 %</stem>
686
- <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
687
- <dt>
688
- <stem type="AsciiMath">r</stem>
689
- </dt>
690
- <dd>
691
- <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
692
- </dd>
693
- </dl></formula>
694
- </foreword>
695
- </preface>
696
- </iso-standard>
697
683
  INPUT
698
684
  #{HTML_HDR}
699
685
  <br/>
@@ -761,6 +747,446 @@ RSpec.describe IsoDoc do
761
747
  OUTPUT
762
748
  end
763
749
 
750
+ it "cross-references requirements" do
751
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
752
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
753
+ <preface>
754
+ <foreword>
755
+ <p>
756
+ <xref target="N1"/>
757
+ <xref target="N2"/>
758
+ <xref target="N"/>
759
+ <xref target="note1"/>
760
+ <xref target="note2"/>
761
+ <xref target="AN"/>
762
+ <xref target="Anote1"/>
763
+ <xref target="Anote2"/>
764
+ </p>
765
+ </foreword>
766
+ <introduction id="intro">
767
+ <requirement id="N1">
768
+ <stem type="AsciiMath">r = 1 %</stem>
769
+ </requirement>
770
+ <clause id="xyz"><title>Preparatory</title>
771
+ <requirement id="N2">
772
+ <stem type="AsciiMath">r = 1 %</stem>
773
+ </requirement>
774
+ </clause>
775
+ </introduction>
776
+ </preface>
777
+ <sections>
778
+ <clause id="scope"><title>Scope</title>
779
+ <requirement id="N">
780
+ <stem type="AsciiMath">r = 1 %</stem>
781
+ </requirement>
782
+ <p><xref target="N"/></p>
783
+ </clause>
784
+ <terms id="terms"/>
785
+ <clause id="widgets"><title>Widgets</title>
786
+ <clause id="widgets1">
787
+ <requirement id="note1">
788
+ <stem type="AsciiMath">r = 1 %</stem>
789
+ </requirement>
790
+ <requirement id="note2">
791
+ <stem type="AsciiMath">r = 1 %</stem>
792
+ </requirement>
793
+ <p> <xref target="note1"/> <xref target="note2"/> </p>
794
+ </clause>
795
+ </clause>
796
+ </sections>
797
+ <annex id="annex1">
798
+ <clause id="annex1a">
799
+ <requirement id="AN">
800
+ <stem type="AsciiMath">r = 1 %</stem>
801
+ </requirement>
802
+ </clause>
803
+ <clause id="annex1b">
804
+ <requirement id="Anote1">
805
+ <stem type="AsciiMath">r = 1 %</stem>
806
+ </requirement>
807
+ <requirement id="Anote2">
808
+ <stem type="AsciiMath">r = 1 %</stem>
809
+ </requirement>
810
+ </clause>
811
+ </annex>
812
+ </iso-standard>
813
+ INPUT
814
+ #{HTML_HDR}
815
+ <br/>
816
+ <div>
817
+ <h1 class="ForewordTitle">Foreword</h1>
818
+ <p>
819
+ <a href="#N1">Introduction, Requirement 1</a>
820
+ <a href="#N2">Preparatory, Requirement 2</a>
821
+ <a href="#N">Clause 1, Requirement 3</a>
822
+ <a href="#note1">Clause 3.1, Requirement 4</a>
823
+ <a href="#note2">Clause 3.1, Requirement 5</a>
824
+ <a href="#AN">Annex A.1, Requirement A.1</a>
825
+ <a href="#Anote1">Annex A.2, Requirement A.2</a>
826
+ <a href="#Anote2">Annex A.2, Requirement A.3</a>
827
+ </p>
828
+ </div>
829
+ <br/>
830
+ <div class="Section3" id="intro">
831
+ <h1 class="IntroTitle">Introduction</h1>
832
+ <div class="require"><p class="AdmonitionTitle">Requirement 1:</p>
833
+ <span class="stem">(#(r = 1 %)#)</span>
834
+ </div>
835
+ <div id="xyz"><h2>Preparatory</h2>
836
+ <div class="require"><p class="AdmonitionTitle">Requirement 2:</p>
837
+ <span class="stem">(#(r = 1 %)#)</span>
838
+ </div>
839
+ </div>
840
+ </div>
841
+ <p class="zzSTDTitle1"/>
842
+ <div id="scope">
843
+ <h1>1.&#160; Scope</h1>
844
+ <div class="require"><p class="AdmonitionTitle">Requirement 3:</p>
845
+ <span class="stem">(#(r = 1 %)#)</span>
846
+ </div>
847
+ <p>
848
+ <a href="#N">Requirement 3</a>
849
+ </p>
850
+ </div>
851
+ <div id="terms"><h1>2.&#160; Terms and definitions</h1><p>No terms and definitions are listed in this document.</p>
852
+ <p>ISO and IEC maintain terminological databases for use in
853
+ standardization at the following addresses:</p>
854
+
855
+ <ul>
856
+ <li> <p>ISO Online browsing platform: available at
857
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
858
+ <li> <p>IEC Electropedia: available at
859
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
860
+ </p> </li> </ul>
861
+ </div>
862
+ <div id="widgets">
863
+ <h1>3.&#160; Widgets</h1>
864
+ <div id="widgets1"><h2>3.1. </h2>
865
+ <div class="require"><p class="AdmonitionTitle">Requirement 4:</p>
866
+ <span class="stem">(#(r = 1 %)#)</span>
867
+ </div>
868
+ <div class="require"><p class="AdmonitionTitle">Requirement 5:</p>
869
+ <span class="stem">(#(r = 1 %)#)</span>
870
+ </div>
871
+ <p> <a href="#note1">Requirement 4</a> <a href="#note2">Requirement 5</a> </p>
872
+ </div>
873
+ </div>
874
+ <br/>
875
+ <div id="annex1" class="Section3">
876
+ <div id="annex1a"><h2>A.1. </h2>
877
+ <div class="require"><p class="AdmonitionTitle">Requirement A.1:</p>
878
+ <span class="stem">(#(r = 1 %)#)</span>
879
+ </div>
880
+ </div>
881
+ <div id="annex1b"><h2>A.2. </h2>
882
+ <div class="require"><p class="AdmonitionTitle">Requirement A.2:</p>
883
+ <span class="stem">(#(r = 1 %)#)</span>
884
+ </div>
885
+ <div class="require"><p class="AdmonitionTitle">Requirement A.3:</p>
886
+ <span class="stem">(#(r = 1 %)#)</span>
887
+ </div>
888
+ </div>
889
+ </div>
890
+ </div>
891
+ </body>
892
+ </html>
893
+ OUTPUT
894
+ end
895
+
896
+ it "cross-references recommendations" do
897
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
898
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
899
+ <preface>
900
+ <foreword>
901
+ <p>
902
+ <xref target="N1"/>
903
+ <xref target="N2"/>
904
+ <xref target="N"/>
905
+ <xref target="note1"/>
906
+ <xref target="note2"/>
907
+ <xref target="AN"/>
908
+ <xref target="Anote1"/>
909
+ <xref target="Anote2"/>
910
+ </p>
911
+ </foreword>
912
+ <introduction id="intro">
913
+ <recommendation id="N1">
914
+ <stem type="AsciiMath">r = 1 %</stem>
915
+ </recommendation>
916
+ <clause id="xyz"><title>Preparatory</title>
917
+ <recommendation id="N2">
918
+ <stem type="AsciiMath">r = 1 %</stem>
919
+ </recommendation>
920
+ </clause>
921
+ </introduction>
922
+ </preface>
923
+ <sections>
924
+ <clause id="scope"><title>Scope</title>
925
+ <recommendation id="N">
926
+ <stem type="AsciiMath">r = 1 %</stem>
927
+ </recommendation>
928
+ <p><xref target="N"/></p>
929
+ </clause>
930
+ <terms id="terms"/>
931
+ <clause id="widgets"><title>Widgets</title>
932
+ <clause id="widgets1">
933
+ <recommendation id="note1">
934
+ <stem type="AsciiMath">r = 1 %</stem>
935
+ </recommendation>
936
+ <recommendation id="note2">
937
+ <stem type="AsciiMath">r = 1 %</stem>
938
+ </recommendation>
939
+ <p> <xref target="note1"/> <xref target="note2"/> </p>
940
+ </clause>
941
+ </clause>
942
+ </sections>
943
+ <annex id="annex1">
944
+ <clause id="annex1a">
945
+ <recommendation id="AN">
946
+ <stem type="AsciiMath">r = 1 %</stem>
947
+ </recommendation>
948
+ </clause>
949
+ <clause id="annex1b">
950
+ <recommendation id="Anote1">
951
+ <stem type="AsciiMath">r = 1 %</stem>
952
+ </recommendation>
953
+ <recommendation id="Anote2">
954
+ <stem type="AsciiMath">r = 1 %</stem>
955
+ </recommendation>
956
+ </clause>
957
+ </annex>
958
+ </iso-standard>
959
+ INPUT
960
+ #{HTML_HDR}
961
+ <br/>
962
+ <div>
963
+ <h1 class="ForewordTitle">Foreword</h1>
964
+ <p>
965
+ <a href="#N1">Introduction, Recommendation 1</a>
966
+ <a href="#N2">Preparatory, Recommendation 2</a>
967
+ <a href="#N">Clause 1, Recommendation 3</a>
968
+ <a href="#note1">Clause 3.1, Recommendation 4</a>
969
+ <a href="#note2">Clause 3.1, Recommendation 5</a>
970
+ <a href="#AN">Annex A.1, Recommendation A.1</a>
971
+ <a href="#Anote1">Annex A.2, Recommendation A.2</a>
972
+ <a href="#Anote2">Annex A.2, Recommendation A.3</a>
973
+ </p>
974
+ </div>
975
+ <br/>
976
+ <div class="Section3" id="intro">
977
+ <h1 class="IntroTitle">Introduction</h1>
978
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 1:</p>
979
+ <span class="stem">(#(r = 1 %)#)</span>
980
+ </div>
981
+ <div id="xyz"><h2>Preparatory</h2>
982
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 2:</p>
983
+ <span class="stem">(#(r = 1 %)#)</span>
984
+ </div>
985
+ </div>
986
+ </div>
987
+ <p class="zzSTDTitle1"/>
988
+ <div id="scope">
989
+ <h1>1.&#160; Scope</h1>
990
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 3:</p>
991
+ <span class="stem">(#(r = 1 %)#)</span>
992
+ </div>
993
+ <p>
994
+ <a href="#N">Recommendation 3</a>
995
+ </p>
996
+ </div>
997
+ <div id="terms"><h1>2.&#160; Terms and definitions</h1><p>No terms and definitions are listed in this document.</p>
998
+ <p>ISO and IEC maintain terminological databases for use in
999
+ standardization at the following addresses:</p>
1000
+
1001
+ <ul>
1002
+ <li> <p>ISO Online browsing platform: available at
1003
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
1004
+ <li> <p>IEC Electropedia: available at
1005
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
1006
+ </p> </li> </ul>
1007
+ </div>
1008
+ <div id="widgets">
1009
+ <h1>3.&#160; Widgets</h1>
1010
+ <div id="widgets1"><h2>3.1. </h2>
1011
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 4:</p>
1012
+ <span class="stem">(#(r = 1 %)#)</span>
1013
+ </div>
1014
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation 5:</p>
1015
+ <span class="stem">(#(r = 1 %)#)</span>
1016
+ </div>
1017
+ <p> <a href="#note1">Recommendation 4</a> <a href="#note2">Recommendation 5</a> </p>
1018
+ </div>
1019
+ </div>
1020
+ <br/>
1021
+ <div id="annex1" class="Section3">
1022
+ <div id="annex1a"><h2>A.1. </h2>
1023
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation A.1:</p>
1024
+ <span class="stem">(#(r = 1 %)#)</span>
1025
+ </div>
1026
+ </div>
1027
+ <div id="annex1b"><h2>A.2. </h2>
1028
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation A.2:</p>
1029
+ <span class="stem">(#(r = 1 %)#)</span>
1030
+ </div>
1031
+ <div class="recommend"><p class="AdmonitionTitle">Recommendation A.3:</p>
1032
+ <span class="stem">(#(r = 1 %)#)</span>
1033
+ </div>
1034
+ </div>
1035
+ </div>
1036
+ </div>
1037
+ </body>
1038
+ </html>
1039
+ OUTPUT
1040
+ end
1041
+
1042
+ it "cross-references permissions" do
1043
+ expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
1044
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1045
+ <preface>
1046
+ <foreword>
1047
+ <p>
1048
+ <xref target="N1"/>
1049
+ <xref target="N2"/>
1050
+ <xref target="N"/>
1051
+ <xref target="note1"/>
1052
+ <xref target="note2"/>
1053
+ <xref target="AN"/>
1054
+ <xref target="Anote1"/>
1055
+ <xref target="Anote2"/>
1056
+ </p>
1057
+ </foreword>
1058
+ <introduction id="intro">
1059
+ <permission id="N1">
1060
+ <stem type="AsciiMath">r = 1 %</stem>
1061
+ </permission>
1062
+ <clause id="xyz"><title>Preparatory</title>
1063
+ <permission id="N2">
1064
+ <stem type="AsciiMath">r = 1 %</stem>
1065
+ </permission>
1066
+ </clause>
1067
+ </introduction>
1068
+ </preface>
1069
+ <sections>
1070
+ <clause id="scope"><title>Scope</title>
1071
+ <permission id="N">
1072
+ <stem type="AsciiMath">r = 1 %</stem>
1073
+ </permission>
1074
+ <p><xref target="N"/></p>
1075
+ </clause>
1076
+ <terms id="terms"/>
1077
+ <clause id="widgets"><title>Widgets</title>
1078
+ <clause id="widgets1">
1079
+ <permission id="note1">
1080
+ <stem type="AsciiMath">r = 1 %</stem>
1081
+ </permission>
1082
+ <permission id="note2">
1083
+ <stem type="AsciiMath">r = 1 %</stem>
1084
+ </permission>
1085
+ <p> <xref target="note1"/> <xref target="note2"/> </p>
1086
+ </clause>
1087
+ </clause>
1088
+ </sections>
1089
+ <annex id="annex1">
1090
+ <clause id="annex1a">
1091
+ <permission id="AN">
1092
+ <stem type="AsciiMath">r = 1 %</stem>
1093
+ </permission>
1094
+ </clause>
1095
+ <clause id="annex1b">
1096
+ <permission id="Anote1">
1097
+ <stem type="AsciiMath">r = 1 %</stem>
1098
+ </permission>
1099
+ <permission id="Anote2">
1100
+ <stem type="AsciiMath">r = 1 %</stem>
1101
+ </permission>
1102
+ </clause>
1103
+ </annex>
1104
+ </iso-standard>
1105
+ INPUT
1106
+ #{HTML_HDR}
1107
+ <br/>
1108
+ <div>
1109
+ <h1 class="ForewordTitle">Foreword</h1>
1110
+ <p>
1111
+ <a href="#N1">Introduction, Permission 1</a>
1112
+ <a href="#N2">Preparatory, Permission 2</a>
1113
+ <a href="#N">Clause 1, Permission 3</a>
1114
+ <a href="#note1">Clause 3.1, Permission 4</a>
1115
+ <a href="#note2">Clause 3.1, Permission 5</a>
1116
+ <a href="#AN">Annex A.1, Permission A.1</a>
1117
+ <a href="#Anote1">Annex A.2, Permission A.2</a>
1118
+ <a href="#Anote2">Annex A.2, Permission A.3</a>
1119
+ </p>
1120
+ </div>
1121
+ <br/>
1122
+ <div class="Section3" id="intro">
1123
+ <h1 class="IntroTitle">Introduction</h1>
1124
+ <div class="permission"><p class="AdmonitionTitle">Permission 1:</p>
1125
+ <span class="stem">(#(r = 1 %)#)</span>
1126
+ </div>
1127
+ <div id="xyz"><h2>Preparatory</h2>
1128
+ <div class="permission"><p class="AdmonitionTitle">Permission 2:</p>
1129
+ <span class="stem">(#(r = 1 %)#)</span>
1130
+ </div>
1131
+ </div>
1132
+ </div>
1133
+ <p class="zzSTDTitle1"/>
1134
+ <div id="scope">
1135
+ <h1>1.&#160; Scope</h1>
1136
+ <div class="permission"><p class="AdmonitionTitle">Permission 3:</p>
1137
+ <span class="stem">(#(r = 1 %)#)</span>
1138
+ </div>
1139
+ <p>
1140
+ <a href="#N">Permission 3</a>
1141
+ </p>
1142
+ </div>
1143
+ <div id="terms"><h1>2.&#160; Terms and definitions</h1><p>No terms and definitions are listed in this document.</p>
1144
+ <p>ISO and IEC maintain terminological databases for use in
1145
+ standardization at the following addresses:</p>
1146
+
1147
+ <ul>
1148
+ <li> <p>ISO Online browsing platform: available at
1149
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
1150
+ <li> <p>IEC Electropedia: available at
1151
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
1152
+ </p> </li> </ul>
1153
+ </div>
1154
+ <div id="widgets">
1155
+ <h1>3.&#160; Widgets</h1>
1156
+ <div id="widgets1"><h2>3.1. </h2>
1157
+ <div class="permission"><p class="AdmonitionTitle">Permission 4:</p>
1158
+ <span class="stem">(#(r = 1 %)#)</span>
1159
+ </div>
1160
+ <div class="permission"><p class="AdmonitionTitle">Permission 5:</p>
1161
+ <span class="stem">(#(r = 1 %)#)</span>
1162
+ </div>
1163
+ <p> <a href="#note1">Permission 4</a> <a href="#note2">Permission 5</a> </p>
1164
+ </div>
1165
+ </div>
1166
+ <br/>
1167
+ <div id="annex1" class="Section3">
1168
+ <div id="annex1a"><h2>A.1. </h2>
1169
+ <div class="permission"><p class="AdmonitionTitle">Permission A.1:</p>
1170
+ <span class="stem">(#(r = 1 %)#)</span>
1171
+ </div>
1172
+ </div>
1173
+ <div id="annex1b"><h2>A.2. </h2>
1174
+ <div class="permission"><p class="AdmonitionTitle">Permission A.2:</p>
1175
+ <span class="stem">(#(r = 1 %)#)</span>
1176
+ </div>
1177
+ <div class="permission"><p class="AdmonitionTitle">Permission A.3:</p>
1178
+ <span class="stem">(#(r = 1 %)#)</span>
1179
+ </div>
1180
+ </div>
1181
+ </div>
1182
+ </div>
1183
+ </body>
1184
+ </html>
1185
+ OUTPUT
1186
+ end
1187
+
1188
+
1189
+
764
1190
  it "cross-references tables" do
765
1191
  expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
766
1192
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -1023,8 +1449,8 @@ RSpec.describe IsoDoc do
1023
1449
  <li> <p>IEC Electropedia: available at
1024
1450
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
1025
1451
  </p> </li> </ul>
1026
- <p class="TermNum" id="_waxy_rice">2.1</p><p class="Terms" style="text-align:left;">waxy rice</p>
1027
- <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
1452
+ <p class="TermNum" id="_waxy_rice">2.1.</p><p class="Terms" style="text-align:left;">waxy rice</p>
1453
+ <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2.</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
1028
1454
  <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
1029
1455
  <div class="Note"><p>Note 2 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div></div>
1030
1456
  </div>
@@ -1166,7 +1592,7 @@ RSpec.describe IsoDoc do
1166
1592
  </p> </li> </ul>
1167
1593
  <div id="I">
1168
1594
  <h2>3.1. Normal Terms</h2>
1169
- <p class="TermNum" id="J">3.1.1</p>
1595
+ <p class="TermNum" id="J">3.1.1.</p>
1170
1596
  <p class="Terms" style="text-align:left;">Term2</p>
1171
1597
 
1172
1598
  </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
@@ -1533,20 +1959,20 @@ RSpec.describe IsoDoc do
1533
1959
  </iso-standard>
1534
1960
  INPUT
1535
1961
  #{HTML_HDR}
1536
- <br/>
1537
- <div>
1538
- <h1 class="ForewordTitle">Foreword</h1>
1539
- <p>
1540
- <a href="#N">Clause 1, a)</a>
1541
- <a href="#note1">Clause 1, a.1)</a>
1542
- <a href="#note2">Clause 1, a.1.i)</a>
1543
- <a href="#AN">Clause 1, a.1.i.A)</a>
1544
- <a href="#Anote1">Clause 1, a.1.i.A.I)</a>
1545
- <a href="#Anote2">Clause 1, a.1.i.A.I.a)</a>
1546
- </p>
1547
- </div>
1548
- <p class="zzSTDTitle1"/>
1549
- <div id="scope">
1962
+ <br/>
1963
+ <div>
1964
+ <h1 class="ForewordTitle">Foreword</h1>
1965
+ <p>
1966
+ <a href="#N">Clause 1, a)</a>
1967
+ <a href="#note1">Clause 1, a.1)</a>
1968
+ <a href="#note2">Clause 1, a.1.i)</a>
1969
+ <a href="#AN">Clause 1, a.1.i.A)</a>
1970
+ <a href="#Anote1">Clause 1, a.1.i.A.I)</a>
1971
+ <a href="#Anote2">Clause 1, a.1.i.A.I.a)</a>
1972
+ </p>
1973
+ </div>
1974
+ <p class="zzSTDTitle1"/>
1975
+ <div id="scope">
1550
1976
  <h1>1.&#160; Scope</h1>
1551
1977
  <ol type="a" id="N1">
1552
1978
  <li id="N"><p>A</p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.17
4
+ version: 0.9.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath