isodoc 1.0.22 → 1.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +12 -5
  3. data/.github/workflows/ubuntu.yml +27 -6
  4. data/.github/workflows/windows.yml +13 -7
  5. data/README.adoc +3 -2
  6. data/lib/isodoc-yaml/i18n-en.yaml +18 -1
  7. data/lib/isodoc-yaml/i18n-fr.yaml +18 -1
  8. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +18 -1
  9. data/lib/isodoc/base_style/bands.scss +6 -3
  10. data/lib/isodoc/base_style/reset.scss +1 -1
  11. data/lib/isodoc/convert.rb +1 -0
  12. data/lib/isodoc/function/blocks.rb +5 -0
  13. data/lib/isodoc/function/cleanup.rb +12 -1
  14. data/lib/isodoc/function/i18n.rb +5 -5
  15. data/lib/isodoc/function/inline.rb +47 -12
  16. data/lib/isodoc/function/references.rb +47 -33
  17. data/lib/isodoc/function/reqt.rb +21 -6
  18. data/lib/isodoc/function/section.rb +18 -8
  19. data/lib/isodoc/function/table.rb +0 -1
  20. data/lib/isodoc/function/to_word_html.rb +4 -2
  21. data/lib/isodoc/function/utils.rb +10 -4
  22. data/lib/isodoc/function/xref_gen.rb +2 -1
  23. data/lib/isodoc/function/xref_sect_gen.rb +24 -24
  24. data/lib/isodoc/headlesshtml_convert.rb +5 -0
  25. data/lib/isodoc/html_convert.rb +5 -0
  26. data/lib/isodoc/html_function/footnotes.rb +2 -2
  27. data/lib/isodoc/html_function/html.rb +3 -0
  28. data/lib/isodoc/html_function/postprocess.rb +3 -2
  29. data/lib/isodoc/metadata.rb +30 -7
  30. data/lib/isodoc/metadata_date.rb +39 -0
  31. data/lib/isodoc/pdf_convert.rb +5 -0
  32. data/lib/isodoc/version.rb +1 -1
  33. data/lib/isodoc/word_convert.rb +5 -0
  34. data/lib/isodoc/word_function/body.rb +0 -4
  35. data/lib/isodoc/word_function/footnotes.rb +2 -2
  36. data/lib/isodoc/word_function/postprocess.rb +13 -2
  37. data/lib/isodoc/word_function/table.rb +1 -3
  38. data/lib/isodoc/xslfo_convert.rb +5 -0
  39. data/spec/isodoc/blocks_spec.rb +188 -8
  40. data/spec/isodoc/cleanup_spec.rb +181 -18
  41. data/spec/isodoc/i18n_spec.rb +12 -12
  42. data/spec/isodoc/inline_spec.rb +65 -5
  43. data/spec/isodoc/metadata_spec.rb +77 -2
  44. data/spec/isodoc/postproc_spec.rb +33 -11
  45. data/spec/isodoc/ref_spec.rb +12 -6
  46. data/spec/isodoc/section_spec.rb +220 -205
  47. data/spec/isodoc/table_spec.rb +24 -24
  48. data/spec/isodoc/terms_spec.rb +50 -6
  49. data/spec/isodoc/xref_spec.rb +64 -26
  50. metadata +3 -2
@@ -715,7 +715,7 @@ INPUT
715
715
  OUTPUT
716
716
  end
717
717
 
718
- it "breaks up very long strings in tables" do
718
+ it "does not break up very long strings in tables by default" do
719
719
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
720
720
  <html xmlns:epub="http://www.idpf.org/2007/ops">
721
721
  <head>
@@ -739,6 +739,7 @@ INPUT
739
739
  <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
740
740
  <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">Rice sample</td>
741
741
  </tr>
742
+ </thead>
742
743
  <tbody>
743
744
  <tr>
744
745
  <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
@@ -775,26 +776,102 @@ INPUT
775
776
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
776
777
  <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>Rice sample</td>
777
778
  </tr>
779
+ </thead>
778
780
  <tbody>
779
781
  <tr>
780
782
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
781
- http://www.example.com/
782
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA/
783
- BBBBBBBBBBBBBBBBBBBBBBBBBBBB
783
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB
784
784
  </td>
785
785
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
786
- http://www.example.com/
787
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
788
- AAAAAAAABBBBBBBBBBBBBBBBBBBBBB BBBBBB
786
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB </td>
787
+ <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
788
+ www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
789
+ </td>
790
+ </tr>
791
+ </tbody>
792
+ </table>
793
+ </div>
794
+ </div>
795
+ </body>
796
+ </head>
797
+ </html>
798
+ OUTPUT
799
+ end
800
+
801
+ it "does not break up very long strings in tables on request in HTML" do
802
+ expect(xmlpp(IsoDoc::HtmlConvert.new({break_up_urls_in_tables: "true"}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
803
+ <html xmlns:epub="http://www.idpf.org/2007/ops">
804
+ <head>
805
+ <title>test</title>
806
+ <body lang="EN-US" link="blue" vlink="#954F72">
807
+ <div class="WordSection1">
808
+ <p>&#160;</p>
809
+ </div>
810
+ <br clear="all" class="section"/>
811
+ <div class="WordSection2">
812
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
813
+ <div>
814
+ <h1 class="ForewordTitle">Foreword</h1>
815
+ <p class="TableTitle" align="center">
816
+ <b>Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield</b>
817
+ </p>
818
+ <table id="tableD-1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0">
819
+ <thead>
820
+ <tr>
821
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
822
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
823
+ <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">Rice sample</td>
824
+ </tr>
825
+ </thead>
826
+ <tbody>
827
+ <tr>
828
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
829
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
830
+ <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
831
+ </tr>
832
+ </tbody>
833
+ </table>
834
+ </div>
835
+ </div>
836
+ </body>
837
+ </html>
838
+ INPUT
839
+ <?xml version='1.0'?>
840
+ <html xmlns:epub='http://www.idpf.org/2007/ops'>
841
+ <head>
842
+ <title>test</title>
843
+ <body lang='EN-US' link='blue' vlink='#954F72'>
844
+ <div class='WordSection1'>
845
+ <p>&#xA0;</p>
846
+ </div>
847
+ <br clear='all' class='section'/>
848
+ <div class='WordSection2'>
849
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
850
+ <div>
851
+ <h1 class='ForewordTitle'>Foreword</h1>
852
+ <p class='TableTitle' align='center'>
853
+ <b>Table 1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</b>
854
+ </p>
855
+ <table id='tableD-1' class='MsoISOTable' border='1' cellspacing='0' cellpadding='0'>
856
+ <thead>
857
+ <tr>
858
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
859
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
860
+ <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>Rice sample</td>
861
+ </tr>
862
+ </thead>
863
+ <tbody>
864
+ <tr>
865
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
866
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB
789
867
  </td>
868
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
869
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
790
870
  <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
791
- www.example.com/
792
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
793
- ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
871
+ www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
794
872
  </td>
795
873
  </tr>
796
874
  </tbody>
797
- </thead>
798
875
  </table>
799
876
  </div>
800
877
  </div>
@@ -804,7 +881,8 @@ ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
804
881
  OUTPUT
805
882
  end
806
883
 
807
- it "breaks up very long strings in tables (Word)" do
884
+
885
+ it "does not break up very long strings in tables by default (Word)" do
808
886
  expect(xmlpp(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
809
887
  <html xmlns:epub="http://www.idpf.org/2007/ops">
810
888
  <head>
@@ -828,16 +906,17 @@ ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
828
906
  <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
829
907
  <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">Rice sample</td>
830
908
  </tr>
909
+ </thead>
831
910
  <tbody>
832
911
  <tr>
833
912
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
834
- http://www.example.com/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA/ BBBBBBBBBBBBBBBBBBBBBBBBBBBB
913
+ http://www.example.com/&amp;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB
835
914
  </td>
836
915
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
837
- http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAABBBBBBBBBBBBBBBBBBBBBB BBBBBB
916
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
838
917
  </td>
839
918
  <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
840
- www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
919
+ www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
841
920
  </td>
842
921
  </tr>
843
922
  </tbody>
@@ -870,20 +949,104 @@ ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
870
949
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
871
950
  <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>Rice sample</td>
872
951
  </tr>
952
+ </thead>
953
+ <tbody>
954
+ <tr>
955
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
956
+ http://www.example.com/&amp;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB
957
+ </td>
958
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
959
+ http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
960
+ </td>
961
+ <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
962
+ www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
963
+ </td>
964
+ </tr>
965
+ </tbody>
966
+ </table>
967
+ </div>
968
+ </div>
969
+ </body>
970
+ </head>
971
+ </html>
972
+ OUTPUT
973
+ end
974
+
975
+ it "breaks up very long strings in tables on request (Word)" do
976
+ expect(xmlpp(IsoDoc::WordConvert.new({break_up_urls_in_tables: "true"}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
977
+ <html xmlns:epub="http://www.idpf.org/2007/ops">
978
+ <head>
979
+ <title>test</title>
980
+ <body lang="EN-US" link="blue" vlink="#954F72">
981
+ <div class="WordSection1">
982
+ <p>&#160;</p>
983
+ </div>
984
+ <br clear="all" class="section"/>
985
+ <div class="WordSection2">
986
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
987
+ <div>
988
+ <h1 class="ForewordTitle">Foreword</h1>
989
+ <p class="TableTitle" align="center">
990
+ <b>Table 1&#160;&#8212; Repeatability and reproducibility of husked rice yield</b>
991
+ </p>
992
+ <table id="tableD-1" class="MsoISOTable" border="1" cellspacing="0" cellpadding="0">
993
+ <thead>
994
+ <tr>
995
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
996
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Description</td>
997
+ <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">Rice sample</td>
998
+ </tr>
999
+ </thead>
1000
+ <tbody>
1001
+ <tr>
1002
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
1003
+ <td align="left" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
1004
+ <td align="center" style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
1005
+ </tr>
1006
+ </tbody>
1007
+ </table>
1008
+ </div>
1009
+ </div>
1010
+ </body>
1011
+ </html>
1012
+ INPUT
1013
+ <?xml version='1.0'?>
1014
+ <html xmlns:epub='http://www.idpf.org/2007/ops'>
1015
+ <head>
1016
+ <title>test</title>
1017
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1018
+ <div class='WordSection1'>
1019
+ <p>&#xA0;</p>
1020
+ </div>
1021
+ <br clear='all' class='section'/>
1022
+ <div class='WordSection2'>
1023
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1024
+ <div>
1025
+ <h1 class='ForewordTitle'>Foreword</h1>
1026
+ <p class='TableTitle' align='center'>
1027
+ <b>Table 1&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield</b>
1028
+ </p>
1029
+ <table id='tableD-1' class='MsoISOTable' border='1' cellspacing='0' cellpadding='0'>
1030
+ <thead>
1031
+ <tr>
1032
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
1033
+ <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>Description</td>
1034
+ <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>Rice sample</td>
1035
+ </tr>
1036
+ </thead>
873
1037
  <tbody>
874
1038
  <tr>
875
1039
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
876
1040
  http://www.example.com/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA/ BBBBBBBBBBBBBBBBBBBBBBBBBBBB
877
1041
  </td>
878
1042
  <td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
879
- http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAABBBBBBBBBBBBBBBBBBBBBB BBBBBB
1043
+ http://www.example.com/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAABBBBBBBBBBBBBBBBBBBBBB BBBBBB
880
1044
  </td>
881
1045
  <td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
882
- www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
1046
+ www.example.com/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
883
1047
  </td>
884
1048
  </tr>
885
1049
  </tbody>
886
- </thead>
887
1050
  </table>
888
1051
  </div>
889
1052
  </div>
@@ -21,7 +21,7 @@ RSpec.describe IsoDoc do
21
21
  <p id="E">Text</p>
22
22
  </clause>
23
23
 
24
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
24
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
25
25
  <title>Normal Terms</title>
26
26
  <term id="J">
27
27
  <preferred>Term2</preferred>
@@ -55,11 +55,11 @@ RSpec.describe IsoDoc do
55
55
  <title>Annex A.1a</title>
56
56
  </clause>
57
57
  </clause>
58
- </annex><bibliography><references id="R" obligation="informative">
58
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
59
59
  <title>Normative References</title>
60
60
  </references><clause id="S" obligation="informative">
61
61
  <title>Bibliography</title>
62
- <references id="T" obligation="informative">
62
+ <references id="T" obligation="informative" normative="false">
63
63
  <title>Bibliography Subsection</title>
64
64
  </references>
65
65
  </clause>
@@ -157,7 +157,7 @@ RSpec.describe IsoDoc do
157
157
  <p id="E">Text</p>
158
158
  </clause>
159
159
 
160
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
160
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
161
161
  <title>Normal Terms</title>
162
162
  <term id="J">
163
163
  <preferred>Term2</preferred>
@@ -191,11 +191,11 @@ RSpec.describe IsoDoc do
191
191
  <title>Annex A.1a</title>
192
192
  </clause>
193
193
  </clause>
194
- </annex><bibliography><references id="R" obligation="informative">
194
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
195
195
  <title>Normative References</title>
196
196
  </references><clause id="S" obligation="informative">
197
197
  <title>Bibliography</title>
198
- <references id="T" obligation="informative">
198
+ <references id="T" obligation="informative" normative="false">
199
199
  <title>Bibliography Subsection</title>
200
200
  </references>
201
201
  </clause>
@@ -293,7 +293,7 @@ RSpec.describe IsoDoc do
293
293
  <p id="E">Text</p>
294
294
  </clause>
295
295
 
296
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
296
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
297
297
  <title>Normal Terms</title>
298
298
  <term id="J">
299
299
  <preferred>Term2</preferred>
@@ -327,11 +327,11 @@ RSpec.describe IsoDoc do
327
327
  <title>Annex A.1a</title>
328
328
  </clause>
329
329
  </clause>
330
- </annex><bibliography><references id="R" obligation="informative">
330
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
331
331
  <title>Normative References</title>
332
332
  </references><clause id="S" obligation="informative">
333
333
  <title>Bibliography</title>
334
- <references id="T" obligation="informative">
334
+ <references id="T" obligation="informative" normative="false">
335
335
  <title>Bibliography Subsection</title>
336
336
  </references>
337
337
  </clause>
@@ -430,7 +430,7 @@ RSpec.describe IsoDoc do
430
430
  <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
431
431
  </clause>
432
432
 
433
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
433
+ <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
434
434
  <title>Normal Terms</title>
435
435
  <term id="J">
436
436
  <preferred>Term2</preferred>
@@ -464,7 +464,7 @@ RSpec.describe IsoDoc do
464
464
  <title>Annex A.1a</title>
465
465
  </clause>
466
466
  </clause>
467
- </annex><bibliography><references id="R" obligation="informative">
467
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
468
468
  <title>Normative References</title>
469
469
  <bibitem id="ISO712" type="standard">
470
470
  <title format="text/plain">Cereals and cereal products</title>
@@ -478,7 +478,7 @@ RSpec.describe IsoDoc do
478
478
  </bibitem>
479
479
  </references><clause id="S" obligation="informative">
480
480
  <title>Bibliography</title>
481
- <references id="T" obligation="informative">
481
+ <references id="T" obligation="informative" normative="false">
482
482
  <title>Bibliography Subsection</title>
483
483
  </references>
484
484
  </clause>
@@ -126,13 +126,31 @@ RSpec.describe IsoDoc do
126
126
  </concept></li>
127
127
  <li><concept>
128
128
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
129
+ <localityStack>
129
130
  <locality type='clause'>
130
131
  <referenceFrom>3.1</referenceFrom>
131
132
  </locality>
133
+ </localityStack>
134
+ <localityStack>
132
135
  <locality type='figure'>
133
- <referenceFrom>a</referenceFrom>
136
+ <referenceFrom>b</referenceFrom>
134
137
  </locality>
135
- <em>word</em>
138
+ </localityStack>
139
+ </eref>
140
+ </concept></li>
141
+ <li><concept>
142
+ <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
143
+ <localityStack>
144
+ <locality type='clause'>
145
+ <referenceFrom>3.1</referenceFrom>
146
+ </locality>
147
+ </localityStack>
148
+ <localityStack>
149
+ <locality type='figure'>
150
+ <referenceFrom>b</referenceFrom>
151
+ </locality>
152
+ </localityStack>
153
+ <em>word</em>
136
154
  </eref>
137
155
  </concept></li>
138
156
  <li><concept term='term'>
@@ -147,7 +165,7 @@ RSpec.describe IsoDoc do
147
165
  <sections>
148
166
  <clause id="clause1"><title>Clause 1</title></clause>
149
167
  </sections>
150
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
168
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
151
169
  <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>
152
170
  <bibitem id="ISO712" type="standard">
153
171
  <title format="text/plain">Cereals or cereal products</title>
@@ -180,6 +198,9 @@ RSpec.describe IsoDoc do
180
198
  <li>
181
199
  [Term defined in <a href='#ISO712'>ISO 712, Clause 3.1, Figure a</a>]
182
200
  </li>
201
+ <li>
202
+ [Term defined in <a href='#ISO712'>ISO 712, Clause 3.1; Figure b</a>]
203
+ </li>
183
204
  <li>
184
205
  <i>word</i>
185
206
  </li>
@@ -393,7 +414,7 @@ OUTPUT
393
414
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
394
415
  </p>
395
416
  </foreword></preface>
396
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
417
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
397
418
  <bibitem id="ISO712" type="standard">
398
419
  <title format="text/plain">Cereals and cereal products</title>
399
420
  <docidentifier>ISO 712</docidentifier>
@@ -436,6 +457,8 @@ OUTPUT
436
457
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
437
458
  <eref type="inline" bibitemid="ISO712"/>
438
459
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
460
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
461
+ <eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
439
462
  <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
440
463
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
441
464
  <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
@@ -446,7 +469,7 @@ OUTPUT
446
469
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
447
470
  </p>
448
471
  </foreword></preface>
449
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
472
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
450
473
  <bibitem id="ISO712" type="standard">
451
474
  <title format="text/plain">Cereals and cereal products</title>
452
475
  <docidentifier>ISO 712</docidentifier>
@@ -469,6 +492,8 @@ OUTPUT
469
492
  <a href="#ISO712">ISO 712</a>
470
493
  <a href="#ISO712">ISO 712</a>
471
494
  <a href="#ISO712">ISO 712, Table 1</a>
495
+ <a href='#ISO712'>ISO 712, Table 1</a>
496
+ <a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
472
497
  <a href="#ISO712">ISO 712, Table 1&#8211;1</a>
473
498
  <a href="#ISO712">ISO 712, Clause 1, Table 1</a>
474
499
  <a href="#ISO712">ISO 712, Clause 1</a>
@@ -490,5 +515,40 @@ OUTPUT
490
515
  OUTPUT
491
516
  end
492
517
 
518
+ it "processes variant" do
519
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
520
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
521
+ <bibdata>
522
+ <language>en</language>
523
+ <script>Latn</script>
524
+ </bibdata>
525
+ <preface>
526
+ <clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
527
+ <clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
528
+ <clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
529
+ </preface>
530
+ </iso-standard>
531
+ INPUT
532
+ #{HTML_HDR}
533
+ <br/>
534
+ <div class='Section3' id='A'>
535
+ <h1 class='IntroTitle'>ABC</h1>
536
+ </div>
537
+ <br/>
538
+ <div class='Section3' id='B'>
539
+ <h1 class='IntroTitle'>GHI</h1>
540
+ </div>
541
+ <br/>
542
+ <div class='Section3' id='C'>
543
+ <h1 class='IntroTitle'>DEF</h1>
544
+ </div>
545
+ <p class='zzSTDTitle1'/>
546
+ </div>
547
+ </body>
548
+ </html>
549
+ OUTPUT
550
+ end
551
+
552
+
493
553
 
494
554
  end