isodoc 1.8.3.3 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
+ =begin
4
5
  it "processes prefatory blocks" do
5
6
  input = <<~INPUT
6
7
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -812,526 +813,530 @@ RSpec.describe IsoDoc do
812
813
  </iso-standard>
813
814
  INPUT
814
815
  html = <<~OUTPUT
815
- <html lang='en'>
816
- <head/>
817
- <body lang='en'>
818
- <div class='title-section'>
819
- <p>&#160;</p>
820
- </div>
821
- <br/>
822
- <div class='prefatory-section'>
823
- <p>&#160;</p>
824
- </div>
825
- <br/>
826
- <div class='main-section'>
827
- <br/>
828
- <div>
829
- <h1 class='AbstractTitle'>
830
- Abstract
831
- <br/>
832
- <br/>
833
- Variant 1
834
- </h1>
835
- </div>
836
- <br/>
837
- <div>
838
- <h1 class='ForewordTitle'>
839
- Foreword
840
- <br/>
841
- <br/>
842
- Variant 1
843
- </h1>
844
- <p id='A'>This is a preamble</p>
845
- </div>
846
- <br/>
847
- <div class='Section3' id='B'>
848
- <h1 class='IntroTitle'>Introduction</h1>
849
- <div id='C'>
850
- <h2>
851
- Introduction Subsection
852
- <br/>
853
- <br/>
854
- Variant 1
855
- </h2>
856
- </div>
857
- </div>
858
- <br/>
859
- <div class='Section3' id='B1'>
860
- <h1 class='IntroTitle'>
861
- Dedication
862
- <br/>
863
- <br/>
864
- Variant 1
865
- </h1>
866
- </div>
867
- <br/>
868
- <div class='Section3' id='B2'>
869
- <h1 class='IntroTitle'>
870
- Note to reader
871
- <br/>
872
- <br/>
873
- Variant 1
874
- </h1>
875
- </div>
876
- <br/>
877
- <div class='Section3' id=''>
878
- <h1 class='IntroTitle'>
879
- Acknowledgements
880
- <br/>
881
- <br/>
882
- Variant 1
883
- </h1>
884
- </div>
885
- <p class='zzSTDTitle1'/>
886
- <div id='NN1' class='Note'>
887
- <p>
888
- <span class='note_label'>NOTE</span>
889
- &#160; Initial note
890
- </p>
891
- </div>
892
- <div id='NN2' class='Admonition'>
893
- <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
894
- <p>Initial admonition</p>
895
- </div>
896
- <div id='D'>
897
- <h1>
898
- 1.&#160; Scope
899
- <br/>
900
- <br/>
901
- Variant 1
902
- </h1>
903
- <p id='E'>Text</p>
904
- </div>
905
- <div>
906
- <h1>
907
- 2.&#160; Normative References
908
- <br/>
909
- <br/>
910
- Variant 1
911
- </h1>
912
- </div>
913
- <div id='H'>
914
- <h1>
915
- 3.&#160; Terms, Definitions, Symbols and Abbreviated Terms
916
- <br/>
917
- <br/>
918
- Variant 1
919
- </h1>
920
- <div id='I'>
921
- <h2>
922
- 3.1.&#160; Normal Terms
923
- <br/>
924
- <br/>
925
- Variant 1
926
- </h2>
927
- <p class='TermNum' id='J'>3.1.1.</p>
928
- <p class='Terms' style='text-align:left;'><b>Term2</b></p>
929
- </div>
930
- <div id='K'>
931
- <h2>
932
- 3.2.&#160; Definitions
933
- <br/>
934
- <br/>
935
- Variant 1
936
- </h2>
937
- <dl>
938
- <dt>
939
- <p>Symbol</p>
940
- </dt>
941
- <dd>Definition</dd>
942
- </dl>
943
- </div>
944
- </div>
945
- <div id='L' class='Symbols'>
946
- <h1>
947
- 4.&#160; Symbols and abbreviated terms
948
- <br/>
949
- <br/>
950
- Variant 1
951
- </h1>
952
- <dl>
953
- <dt>
954
- <p>Symbol</p>
955
- </dt>
956
- <dd>Definition</dd>
957
- </dl>
958
- </div>
959
- <div id='M'>
960
- <h1>
961
- 5.&#160; Clause 4
962
- <br/>
963
- <br/>
964
- Variant 1
965
- </h1>
966
- <div id='N'>
967
- <h2>
968
- 5.1.&#160; Introduction
969
- <br/>
970
- <br/>
971
- Variant 1
972
- </h2>
973
- </div>
974
- <div id='O'>
975
- <h2>
976
- 5.2.&#160; Clause 4.2
977
- <br/>
978
- <br/>
979
- Variant 1
980
- </h2>
981
- </div>
982
- <div id='O1'>
983
- <h2>5.3.</h2>
984
- </div>
985
- </div>
986
- <br/>
987
- <div id='P' class='Section3'>
988
- <h1 class='Annex'>
989
- <b>Annex A</b>
990
- <br/>
991
- (normative)
992
- <br/>
993
- <br/>
994
- <b>Annex</b>
995
- <br/>
996
- <br/>
997
- Variant 1
998
- </h1>
999
- <div id='Q'>
1000
- <h2>
1001
- A.1.&#160; Annex A.1
1002
- <br/>
1003
- <br/>
1004
- Variant 1
1005
- </h2>
1006
- <div id='Q1'>
1007
- <h3>
1008
- A.1.1.&#160; Annex A.1a
1009
- <br/>
1010
- <br/>
1011
- Variant 1
1012
- </h3>
1013
- </div>
1014
- <div>
1015
- <h3 class='Section3'>
1016
- A.1.2.&#160; Annex Bibliography
1017
- <br/>
1018
- <br/>
1019
- Variant 1
1020
- </h3>
1021
- </div>
1022
- </div>
1023
- </div>
1024
- <br/>
1025
- <div id='P1' class='Section3'>
1026
- <h1 class='Annex'>
1027
- <b>Annex B</b>
1028
- <br/>
1029
- (normative)
1030
- </h1>
1031
- </div>
1032
- <br/>
1033
- <div>
1034
- <h1 class='Section3'>Bibliography</h1>
1035
- <div>
1036
- <h2 class='Section3'>
1037
- Bibliography Subsection
1038
- <br/>
1039
- <br/>
1040
- Variant 1
1041
- </h2>
1042
- </div>
1043
- </div>
1044
- </div>
1045
- </body>
1046
- </html>
816
+ <html lang='en'>
817
+ <head/>
818
+ <body lang='en'>
819
+ <div class='title-section'>
820
+ <p>&#160;</p>
821
+ </div>
822
+ <br/>
823
+ <div class='prefatory-section'>
824
+ <p>&#160;</p>
825
+ </div>
826
+ <br/>
827
+ <div class='main-section'>
828
+ <br/>
829
+ <div>
830
+ <h1 class='AbstractTitle'>
831
+ Abstract
832
+ <br/>
833
+ <br/>
834
+ Variant 1
835
+ </h1>
836
+ </div>
837
+ <br/>
838
+ <div>
839
+ <h1 class='ForewordTitle'>
840
+ Foreword
841
+ <br/>
842
+ <br/>
843
+ Variant 1
844
+ </h1>
845
+ <p id='A'>This is a preamble</p>
846
+ </div>
847
+ <br/>
848
+ <div class='Section3' id='B'>
849
+ <h1 class='IntroTitle'>Introduction</h1>
850
+ <div id='C'>
851
+ <h2>
852
+ Introduction Subsection
853
+ <br/>
854
+ <br/>
855
+ Variant 1
856
+ </h2>
857
+ </div>
858
+ </div>
859
+ <br/>
860
+ <div class='Section3' id='B1'>
861
+ <h1 class='IntroTitle'>
862
+ Dedication
863
+ <br/>
864
+ <br/>
865
+ Variant 1
866
+ </h1>
867
+ </div>
868
+ <br/>
869
+ <div class='Section3' id='B2'>
870
+ <h1 class='IntroTitle'>
871
+ Note to reader
872
+ <br/>
873
+ <br/>
874
+ Variant 1
875
+ </h1>
876
+ </div>
877
+ <br/>
878
+ <div class='Section3' id=''>
879
+ <h1 class='IntroTitle'>
880
+ Acknowledgements
881
+ <br/>
882
+ <br/>
883
+ Variant 1
884
+ </h1>
885
+ </div>
886
+ <p class='zzSTDTitle1'/>
887
+ <div id='NN1' class='Note'>
888
+ <p>
889
+ <span class='note_label'>NOTE</span>
890
+ &#160; Initial note
891
+ </p>
892
+ </div>
893
+ <div id='NN2' class='Admonition'>
894
+ <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
895
+ <p>Initial admonition</p>
896
+ </div>
897
+ <div id='D'>
898
+ <h1>
899
+ 1.&#160; Scope
900
+ <br/>
901
+ <br/>
902
+ Variant 1
903
+ </h1>
904
+ <p id='E'>Text</p>
905
+ </div>
906
+ <div>
907
+ <h1>
908
+ 2.&#160; Normative References
909
+ <br/>
910
+ <br/>
911
+ Variant 1
912
+ </h1>
913
+ </div>
914
+ <div id='H'>
915
+ <h1>
916
+ 3.&#160; Terms, Definitions, Symbols and Abbreviated Terms
917
+ <br/>
918
+ <br/>
919
+ Variant 1
920
+ </h1>
921
+ <div id='I'>
922
+ <h2>
923
+ 3.1.&#160; Normal Terms
924
+ <br/>
925
+ <br/>
926
+ Variant 1
927
+ </h2>
928
+ <p class='TermNum' id='J'>3.1.1.</p>
929
+ <p class='Terms' style='text-align:left;'><b>Term2</b></p>
930
+ </div>
931
+ <div id='K'>
932
+ <h2>
933
+ 3.2.&#160; Definitions
934
+ <br/>
935
+ <br/>
936
+ Variant 1
937
+ </h2>
938
+ <dl>
939
+ <dt>
940
+ <p>Symbol</p>
941
+ </dt>
942
+ <dd>Definition</dd>
943
+ </dl>
944
+ </div>
945
+ </div>
946
+ <div id='L' class='Symbols'>
947
+ <h1>
948
+ 4.&#160; Symbols and abbreviated terms
949
+ <br/>
950
+ <br/>
951
+ Variant 1
952
+ </h1>
953
+ <dl>
954
+ <dt>
955
+ <p>Symbol</p>
956
+ </dt>
957
+ <dd>Definition</dd>
958
+ </dl>
959
+ </div>
960
+ <div id='M'>
961
+ <h1>
962
+ 5.&#160; Clause 4
963
+ <br/>
964
+ <br/>
965
+ Variant 1
966
+ </h1>
967
+ <div id='N'>
968
+ <h2>
969
+ 5.1.&#160; Introduction
970
+ <br/>
971
+ <br/>
972
+ Variant 1
973
+ </h2>
974
+ </div>
975
+ <div id='O'>
976
+ <h2>
977
+ 5.2.&#160; Clause 4.2
978
+ <br/>
979
+ <br/>
980
+ Variant 1
981
+ </h2>
982
+ </div>
983
+ <div id='O1'>
984
+ <h2>5.3.</h2>
985
+ </div>
986
+ </div>
987
+ <br/>
988
+ <div id='P' class='Section3'>
989
+ <h1 class='Annex'>
990
+ <b>Annex A</b>
991
+ <br/>
992
+ (normative)
993
+ <br/>
994
+ <br/>
995
+ <b>Annex</b>
996
+ <br/>
997
+ <br/>
998
+ Variant 1
999
+ </h1>
1000
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1001
+ <div id='Q'>
1002
+ <h2>
1003
+ A.1.&#160; Annex A.1
1004
+ <br/>
1005
+ <br/>
1006
+ Variant 1
1007
+ </h2>
1008
+ <div id='Q1'>
1009
+ <h3>
1010
+ A.1.1.&#160; Annex A.1a
1011
+ <br/>
1012
+ <br/>
1013
+ Variant 1
1014
+ </h3>
1015
+ </div>
1016
+ <div>
1017
+ <h3 class='Section3'>
1018
+ A.1.2.&#160; Annex Bibliography
1019
+ <br/>
1020
+ <br/>
1021
+ Variant 1
1022
+ </h3>
1023
+ </div>
1024
+ </div>
1025
+ </div>
1026
+ <br/>
1027
+ <div id='P1' class='Section3'>
1028
+ <h1 class='Annex'>
1029
+ <b>Annex B</b>
1030
+ <br/>
1031
+ (normative)
1032
+ </h1>
1033
+ </div>
1034
+ <br/>
1035
+ <div>
1036
+ <h1 class='Section3'>Bibliography</h1>
1037
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1038
+ <div>
1039
+ <h2 class='Section3'>
1040
+ Bibliography Subsection
1041
+ <br/>
1042
+ <br/>
1043
+ Variant 1
1044
+ </h2>
1045
+ </div>
1046
+ </div>
1047
+ </div>
1048
+ </body>
1049
+ </html>
1047
1050
  OUTPUT
1048
1051
  word = <<~OUTPUT
1049
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1050
- <head>
1051
- <style>
1052
- </style>
1053
- </head>
1054
- <body lang='EN-US' link='blue' vlink='#954F72'>
1055
- <div class='WordSection1'>
1056
- <p>&#160;</p>
1057
- </div>
1058
- <p>
1059
- <br clear='all' class='section'/>
1060
- </p>
1061
- <div class='WordSection2'>
1062
- <p>
1063
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1064
- </p>
1065
- <div>
1066
- <h1 class='AbstractTitle'>
1067
- Abstract
1068
- <br/>
1069
- <br/>
1070
- Variant 1
1071
- </h1>
1072
- </div>
1073
- <p>
1074
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1075
- </p>
1076
- <div>
1077
- <h1 class='ForewordTitle'>
1078
- Foreword
1079
- <br/>
1080
- <br/>
1081
- Variant 1
1082
- </h1>
1083
- <p id='A'>This is a preamble</p>
1084
- </div>
1085
- <p>
1086
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1087
- </p>
1088
- <div class='Section3' id='B'>
1089
- <h1 class='IntroTitle'>Introduction</h1>
1090
- <div id='C'>
1091
- <h2>
1092
- Introduction Subsection
1093
- <br/>
1094
- <br/>
1095
- Variant 1
1096
- </h2>
1097
- </div>
1098
- </div>
1099
- <p>
1100
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1101
- </p>
1102
- <div class='Section3' id='B1'>
1103
- <h1 class='IntroTitle'>
1104
- Dedication
1105
- <br/>
1106
- <br/>
1107
- Variant 1
1108
- </h1>
1109
- </div>
1110
- <p>
1111
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1112
- </p>
1113
- <div class='Section3' id='B2'>
1114
- <h1 class='IntroTitle'>
1115
- Note to reader
1116
- <br/>
1117
- <br/>
1118
- Variant 1
1119
- </h1>
1120
- </div>
1121
- <p>
1122
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1123
- </p>
1124
- <div class='Section3' id=''>
1125
- <h1 class='IntroTitle'>
1126
- Acknowledgements
1127
- <br/>
1128
- <br/>
1129
- Variant 1
1130
- </h1>
1131
- </div>
1132
- <p>&#160;</p>
1133
- </div>
1134
- <p>
1135
- <br clear='all' class='section'/>
1136
- </p>
1137
- <div class='WordSection3'>
1138
- <p class='zzSTDTitle1'/>
1139
- <div id='NN1' class='Note'>
1140
- <p class='Note'>
1141
- <span class='note_label'>NOTE</span>
1142
- <span style='mso-tab-count:1'>&#160; </span>
1143
- Initial note
1144
- </p>
1145
- </div>
1146
- <div id='NN2' class='Admonition'>
1147
- <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
1148
- <p>Initial admonition</p>
1149
- </div>
1150
- <div id='D'>
1151
- <h1>
1152
- 1.
1153
- <span style='mso-tab-count:1'>&#160; </span>
1154
- Scope
1155
- <br/>
1156
- <br/>
1157
- Variant 1
1158
- </h1>
1159
- <p id='E'>Text</p>
1160
- </div>
1161
- <div>
1162
- <h1>
1163
- 2.
1164
- <span style='mso-tab-count:1'>&#160; </span>
1165
- Normative References
1166
- <br/>
1167
- <br/>
1168
- Variant 1
1169
- </h1>
1170
- </div>
1171
- <div id='H'>
1172
- <h1>
1173
- 3.
1174
- <span style='mso-tab-count:1'>&#160; </span>
1175
- Terms, Definitions, Symbols and Abbreviated Terms
1176
- <br/>
1177
- <br/>
1178
- Variant 1
1179
- </h1>
1180
- <div id='I'>
1181
- <h2>
1182
- 3.1.
1183
- <span style='mso-tab-count:1'>&#160; </span>
1184
- Normal Terms
1185
- <br/>
1186
- <br/>
1187
- Variant 1
1188
- </h2>
1189
- <p class='TermNum' id='J'>3.1.1.</p>
1190
- <p class='Terms' style='text-align:left;'><b>Term2</b></p>
1191
- </div>
1192
- <div id='K'>
1193
- <h2>
1194
- 3.2.
1195
- <span style='mso-tab-count:1'>&#160; </span>
1196
- Definitions
1197
- <br/>
1198
- <br/>
1199
- Variant 1
1200
- </h2>
1201
- <table class='dl'>
1202
- <tr>
1203
- <td valign='top' align='left'>
1204
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1205
- </td>
1206
- <td valign='top'>Definition</td>
1207
- </tr>
1208
- </table>
1209
- </div>
1210
- </div>
1211
- <div id='L' class='Symbols'>
1212
- <h1>
1213
- 4.
1214
- <span style='mso-tab-count:1'>&#160; </span>
1215
- Symbols and abbreviated terms
1216
- <br/>
1217
- <br/>
1218
- Variant 1
1219
- </h1>
1220
- <table class='dl'>
1221
- <tr>
1222
- <td valign='top' align='left'>
1223
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1224
- </td>
1225
- <td valign='top'>Definition</td>
1226
- </tr>
1227
- </table>
1228
- </div>
1229
- <div id='M'>
1230
- <h1>
1231
- 5.
1232
- <span style='mso-tab-count:1'>&#160; </span>
1233
- Clause 4
1234
- <br/>
1235
- <br/>
1236
- Variant 1
1237
- </h1>
1238
- <div id='N'>
1239
- <h2>
1240
- 5.1.
1241
- <span style='mso-tab-count:1'>&#160; </span>
1242
- Introduction
1243
- <br/>
1244
- <br/>
1245
- Variant 1
1246
- </h2>
1247
- </div>
1248
- <div id='O'>
1249
- <h2>
1250
- 5.2.
1251
- <span style='mso-tab-count:1'>&#160; </span>
1252
- Clause 4.2
1253
- <br/>
1254
- <br/>
1255
- Variant 1
1256
- </h2>
1257
- </div>
1258
- <div id='O1'>
1259
- <h2>5.3.</h2>
1260
- </div>
1261
- </div>
1262
- <p>
1263
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1264
- </p>
1265
- <div id='P' class='Section3'>
1266
- <h1 class='Annex'>
1267
- <b>Annex A</b>
1268
- <br/>
1269
- (normative)
1270
- <br/>
1271
- <br/>
1272
- <b>Annex</b>
1273
- <br/>
1274
- <br/>
1275
- Variant 1
1276
- </h1>
1277
- <div id='Q'>
1278
- <h2>
1279
- A.1.
1280
- <span style='mso-tab-count:1'>&#160; </span>
1281
- Annex A.1
1282
- <br/>
1283
- <br/>
1284
- Variant 1
1285
- </h2>
1286
- <div id='Q1'>
1287
- <h3>
1288
- A.1.1.
1289
- <span style='mso-tab-count:1'>&#160; </span>
1290
- Annex A.1a
1291
- <br/>
1292
- <br/>
1293
- Variant 1
1294
- </h3>
1295
- </div>
1296
- <div>
1297
- <h3 class='Section3'>
1298
- A.1.2.
1299
- <span style='mso-tab-count:1'>&#160; </span>
1300
- Annex Bibliography
1301
- <br/>
1302
- <br/>
1303
- Variant 1
1304
- </h3>
1305
- </div>
1306
- </div>
1307
- </div>
1308
- <p>
1309
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1310
- </p>
1311
- <div id='P1' class='Section3'>
1312
- <h1 class='Annex'>
1313
- <b>Annex B</b>
1314
- <br/>
1315
- (normative)
1316
- </h1>
1317
- </div>
1318
- <p>
1319
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1320
- </p>
1321
- <div>
1322
- <h1 class='Section3'>Bibliography</h1>
1323
- <div>
1324
- <h2 class='Section3'>
1325
- Bibliography Subsection
1326
- <br/>
1327
- <br/>
1328
- Variant 1
1329
- </h2>
1330
- </div>
1331
- </div>
1332
- </div>
1333
- </body>
1334
- </html>
1052
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1053
+ <head>
1054
+ <style>
1055
+ </style>
1056
+ </head>
1057
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1058
+ <div class='WordSection1'>
1059
+ <p>&#160;</p>
1060
+ </div>
1061
+ <p>
1062
+ <br clear='all' class='section'/>
1063
+ </p>
1064
+ <div class='WordSection2'>
1065
+ <p>
1066
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1067
+ </p>
1068
+ <div>
1069
+ <h1 class='AbstractTitle'>
1070
+ Abstract
1071
+ <br/>
1072
+ <br/>
1073
+ Variant 1
1074
+ </h1>
1075
+ </div>
1076
+ <p>
1077
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1078
+ </p>
1079
+ <div>
1080
+ <h1 class='ForewordTitle'>
1081
+ Foreword
1082
+ <br/>
1083
+ <br/>
1084
+ Variant 1
1085
+ </h1>
1086
+ <p id='A'>This is a preamble</p>
1087
+ </div>
1088
+ <p>
1089
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1090
+ </p>
1091
+ <div class='Section3' id='B'>
1092
+ <h1 class='IntroTitle'>Introduction</h1>
1093
+ <div id='C'>
1094
+ <h2>
1095
+ Introduction Subsection
1096
+ <br/>
1097
+ <br/>
1098
+ Variant 1
1099
+ </h2>
1100
+ </div>
1101
+ </div>
1102
+ <p>
1103
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1104
+ </p>
1105
+ <div class='Section3' id='B1'>
1106
+ <h1 class='IntroTitle'>
1107
+ Dedication
1108
+ <br/>
1109
+ <br/>
1110
+ Variant 1
1111
+ </h1>
1112
+ </div>
1113
+ <p>
1114
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1115
+ </p>
1116
+ <div class='Section3' id='B2'>
1117
+ <h1 class='IntroTitle'>
1118
+ Note to reader
1119
+ <br/>
1120
+ <br/>
1121
+ Variant 1
1122
+ </h1>
1123
+ </div>
1124
+ <p>
1125
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1126
+ </p>
1127
+ <div class='Section3' id=''>
1128
+ <h1 class='IntroTitle'>
1129
+ Acknowledgements
1130
+ <br/>
1131
+ <br/>
1132
+ Variant 1
1133
+ </h1>
1134
+ </div>
1135
+ <p>&#160;</p>
1136
+ </div>
1137
+ <p>
1138
+ <br clear='all' class='section'/>
1139
+ </p>
1140
+ <div class='WordSection3'>
1141
+ <p class='zzSTDTitle1'/>
1142
+ <div id='NN1' class='Note'>
1143
+ <p class='Note'>
1144
+ <span class='note_label'>NOTE</span>
1145
+ <span style='mso-tab-count:1'>&#160; </span>
1146
+ Initial note
1147
+ </p>
1148
+ </div>
1149
+ <div id='NN2' class='Admonition'>
1150
+ <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
1151
+ <p>Initial admonition</p>
1152
+ </div>
1153
+ <div id='D'>
1154
+ <h1>
1155
+ 1.
1156
+ <span style='mso-tab-count:1'>&#160; </span>
1157
+ Scope
1158
+ <br/>
1159
+ <br/>
1160
+ Variant 1
1161
+ </h1>
1162
+ <p id='E'>Text</p>
1163
+ </div>
1164
+ <div>
1165
+ <h1>
1166
+ 2.
1167
+ <span style='mso-tab-count:1'>&#160; </span>
1168
+ Normative References
1169
+ <br/>
1170
+ <br/>
1171
+ Variant 1
1172
+ </h1>
1173
+ </div>
1174
+ <div id='H'>
1175
+ <h1>
1176
+ 3.
1177
+ <span style='mso-tab-count:1'>&#160; </span>
1178
+ Terms, Definitions, Symbols and Abbreviated Terms
1179
+ <br/>
1180
+ <br/>
1181
+ Variant 1
1182
+ </h1>
1183
+ <div id='I'>
1184
+ <h2>
1185
+ 3.1.
1186
+ <span style='mso-tab-count:1'>&#160; </span>
1187
+ Normal Terms
1188
+ <br/>
1189
+ <br/>
1190
+ Variant 1
1191
+ </h2>
1192
+ <p class='TermNum' id='J'>3.1.1.</p>
1193
+ <p class='Terms' style='text-align:left;'><b>Term2</b></p>
1194
+ </div>
1195
+ <div id='K'>
1196
+ <h2>
1197
+ 3.2.
1198
+ <span style='mso-tab-count:1'>&#160; </span>
1199
+ Definitions
1200
+ <br/>
1201
+ <br/>
1202
+ Variant 1
1203
+ </h2>
1204
+ <table class='dl'>
1205
+ <tr>
1206
+ <td valign='top' align='left'>
1207
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1208
+ </td>
1209
+ <td valign='top'>Definition</td>
1210
+ </tr>
1211
+ </table>
1212
+ </div>
1213
+ </div>
1214
+ <div id='L' class='Symbols'>
1215
+ <h1>
1216
+ 4.
1217
+ <span style='mso-tab-count:1'>&#160; </span>
1218
+ Symbols and abbreviated terms
1219
+ <br/>
1220
+ <br/>
1221
+ Variant 1
1222
+ </h1>
1223
+ <table class='dl'>
1224
+ <tr>
1225
+ <td valign='top' align='left'>
1226
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1227
+ </td>
1228
+ <td valign='top'>Definition</td>
1229
+ </tr>
1230
+ </table>
1231
+ </div>
1232
+ <div id='M'>
1233
+ <h1>
1234
+ 5.
1235
+ <span style='mso-tab-count:1'>&#160; </span>
1236
+ Clause 4
1237
+ <br/>
1238
+ <br/>
1239
+ Variant 1
1240
+ </h1>
1241
+ <div id='N'>
1242
+ <h2>
1243
+ 5.1.
1244
+ <span style='mso-tab-count:1'>&#160; </span>
1245
+ Introduction
1246
+ <br/>
1247
+ <br/>
1248
+ Variant 1
1249
+ </h2>
1250
+ </div>
1251
+ <div id='O'>
1252
+ <h2>
1253
+ 5.2.
1254
+ <span style='mso-tab-count:1'>&#160; </span>
1255
+ Clause 4.2
1256
+ <br/>
1257
+ <br/>
1258
+ Variant 1
1259
+ </h2>
1260
+ </div>
1261
+ <div id='O1'>
1262
+ <h2>5.3.</h2>
1263
+ </div>
1264
+ </div>
1265
+ <p>
1266
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1267
+ </p>
1268
+ <div id='P' class='Section3'>
1269
+ <h1 class='Annex'>
1270
+ <b>Annex A</b>
1271
+ <br/>
1272
+ (normative)
1273
+ <br/>
1274
+ <br/>
1275
+ <b>Annex</b>
1276
+ <br/>
1277
+ <br/>
1278
+ Variant 1
1279
+ </h1>
1280
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1281
+ <div id='Q'>
1282
+ <h2>
1283
+ A.1.
1284
+ <span style='mso-tab-count:1'>&#160; </span>
1285
+ Annex A.1
1286
+ <br/>
1287
+ <br/>
1288
+ Variant 1
1289
+ </h2>
1290
+ <div id='Q1'>
1291
+ <h3>
1292
+ A.1.1.
1293
+ <span style='mso-tab-count:1'>&#160; </span>
1294
+ Annex A.1a
1295
+ <br/>
1296
+ <br/>
1297
+ Variant 1
1298
+ </h3>
1299
+ </div>
1300
+ <div>
1301
+ <h3 class='Section3'>
1302
+ A.1.2.
1303
+ <span style='mso-tab-count:1'>&#160; </span>
1304
+ Annex Bibliography
1305
+ <br/>
1306
+ <br/>
1307
+ Variant 1
1308
+ </h3>
1309
+ </div>
1310
+ </div>
1311
+ </div>
1312
+ <p>
1313
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1314
+ </p>
1315
+ <div id='P1' class='Section3'>
1316
+ <h1 class='Annex'>
1317
+ <b>Annex B</b>
1318
+ <br/>
1319
+ (normative)
1320
+ </h1>
1321
+ </div>
1322
+ <p>
1323
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1324
+ </p>
1325
+ <div>
1326
+ <h1 class='Section3'>Bibliography</h1>
1327
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1328
+ <div>
1329
+ <h2 class='Section3'>
1330
+ Bibliography Subsection
1331
+ <br/>
1332
+ <br/>
1333
+ Variant 1
1334
+ </h2>
1335
+ </div>
1336
+ </div>
1337
+ </div>
1338
+ </body>
1339
+ </html>
1335
1340
  OUTPUT
1336
1341
  presxml = IsoDoc::PresentationXMLConvert.new({})
1337
1342
  .convert("test", input, true)
@@ -1487,8 +1492,220 @@ RSpec.describe IsoDoc do
1487
1492
  </bibliography>
1488
1493
  </iso-standard>
1489
1494
  OUTPUT
1490
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
1491
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1495
+ expect(xmlpp(IsoDoc::PresentationXMLConvert
1496
+ .new({ suppressheadingnumbers: true })
1497
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1498
+ end
1499
+ =end
1500
+ it "processes floating titles" do
1501
+ input = <<~INPUT
1502
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1503
+ <preface>
1504
+ <floating-title depth="1">A0</p>
1505
+ <introduction id="B" obligation="informative">
1506
+ <title>Introduction</title>
1507
+ <floating-title depth="1">A</p>
1508
+ <clause id="B1" obligation="informative">
1509
+ <title>Introduction Subsection</title>
1510
+ <floating-title depth="2">B</p>
1511
+ <clause id="B2" obligation="informative">
1512
+ <title>Introduction Sub-subsection</title>
1513
+ <floating-title depth="1">C</p>
1514
+ </clause>
1515
+ </clause>
1516
+ </introduction>
1517
+ </preface>
1518
+ <sections>
1519
+ <clause id="C" obligation="informative">
1520
+ <title>Introduction</title>
1521
+ <floating-title depth="1">A</p>
1522
+ <clause id="C1" obligation="informative">
1523
+ <title>Introduction Subsection</title>
1524
+ <floating-title depth="2">B</p>
1525
+ <clause id="C2" obligation="informative">
1526
+ <title>Introduction Sub-subsection</title>
1527
+ <floating-title depth="1">C</p>
1528
+ </clause>
1529
+ </clause>
1530
+ </clause>
1531
+ <floating-title depth="1">D</p>
1532
+ <clause id="C4"><title>Clause 2</title></clause>
1533
+ </sections>
1534
+ </iso-standard>
1535
+ INPUT
1536
+
1537
+ presxml = <<~PRESXML
1538
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1539
+ <preface>
1540
+ <p depth='1' type='floating-title' displayorder='1'>A0</p>
1541
+ <introduction id='B' obligation='informative' displayorder='2'>
1542
+ <title>Introduction</title>
1543
+ <p depth='1' type='floating-title'>A</p>
1544
+ <clause id='B1' obligation='informative'>
1545
+ <title depth='2'>Introduction Subsection</title>
1546
+ <p depth='2' type='floating-title'>B</p>
1547
+ <clause id='B2' obligation='informative'>
1548
+ <title depth='3'>Introduction Sub-subsection</title>
1549
+ <p depth='1' type='floating-title'>C</p>
1550
+ </clause>
1551
+ </clause>
1552
+ </introduction>
1553
+ </preface>
1554
+ <sections>
1555
+ <clause id='C' obligation='informative' displayorder='3'>
1556
+ <title depth='1'>
1557
+ 1.
1558
+ <tab/>
1559
+ Introduction
1560
+ </title>
1561
+ <p depth='1' type='floating-title'>A</p>
1562
+ <clause id='C1' obligation='informative'>
1563
+ <title depth='2'>
1564
+ 1.1.
1565
+ <tab/>
1566
+ Introduction Subsection
1567
+ </title>
1568
+ <p depth='2' type='floating-title'>B</p>
1569
+ <clause id='C2' obligation='informative'>
1570
+ <title depth='3'>
1571
+ 1.1.1.
1572
+ <tab/>
1573
+ Introduction Sub-subsection
1574
+ </title>
1575
+ <p depth='1' type='floating-title'>C</p>
1576
+ </clause>
1577
+ </clause>
1578
+ </clause>
1579
+ <p depth='1' type='floating-title'>D</p>
1580
+ <clause id='C4' displayorder='4'>
1581
+ <title depth='1'>
1582
+ 2.
1583
+ <tab/>
1584
+ Clause 2
1585
+ </title>
1586
+ </clause>
1587
+ </sections>
1588
+ </iso-standard>
1589
+ PRESXML
1590
+
1591
+ html = <<~OUTPUT
1592
+ #{HTML_HDR}
1593
+ <p class='h1'>A0</p>
1594
+ <br/>
1595
+ <div class='Section3' id='B'>
1596
+ <p class='h1'>A0</p>
1597
+ <h1 class='IntroTitle'>Introduction</h1>
1598
+ <p class='h1'>A</p>
1599
+ <div id='B1'>
1600
+ <h2>Introduction Subsection</h2>
1601
+ <p class='h2'>B</p>
1602
+ <div id='B2'>
1603
+ <h3>Introduction Sub-subsection</h3>
1604
+ <p class='h1'>C</p>
1605
+ </div>
1606
+ </div>
1607
+ </div>
1608
+ <p class='zzSTDTitle1'/>
1609
+ <div id='C'>
1610
+ <h1> 1. &#160; Introduction </h1>
1611
+ <p class='h1'>A</p>
1612
+ <div id='C1'>
1613
+ <h2> 1.1. &#160; Introduction Subsection </h2>
1614
+ <p class='h2'>B</p>
1615
+ <div id='C2'>
1616
+ <h3> 1.1.1. &#160; Introduction Sub-subsection </h3>
1617
+ <p class='h1'>C</p>
1618
+ </div>
1619
+ </div>
1620
+ </div>
1621
+ <div id='C4'>
1622
+ <p class='h1'>D</p>
1623
+ <h1> 2. &#160; Clause 2 </h1>
1624
+ </div>
1625
+ </div>
1626
+ </body>
1627
+ </html>
1628
+ OUTPUT
1629
+
1630
+ word = <<~OUTPUT
1631
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1632
+ <head>
1633
+ <style></style>
1634
+ </head>
1635
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1636
+ <div class='WordSection1'>
1637
+ <p>&#160;</p>
1638
+ </div>
1639
+ <p>
1640
+ <br clear='all' class='section'/>
1641
+ </p>
1642
+ <div class='WordSection2'>
1643
+ <p>A0</p>
1644
+ <p>
1645
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1646
+ </p>
1647
+ <div class='Section3' id='B'>
1648
+ <p>A0</p>
1649
+ <h1 class='IntroTitle'>Introduction</h1>
1650
+ <p>A</p>
1651
+ <div id='B1'>
1652
+ <h2>Introduction Subsection</h2>
1653
+ <p>B</p>
1654
+ <div id='B2'>
1655
+ <h3>Introduction Sub-subsection</h3>
1656
+ <p>C</p>
1657
+ </div>
1658
+ </div>
1659
+ </div>
1660
+ <p>&#160;</p>
1661
+ </div>
1662
+ <p>
1663
+ <br clear='all' class='section'/>
1664
+ </p>
1665
+ <div class='WordSection3'>
1666
+ <p class='zzSTDTitle1'/>
1667
+ <div id='C'>
1668
+ <h1>
1669
+ 1.
1670
+ <span style='mso-tab-count:1'>&#160; </span>
1671
+ Introduction
1672
+ </h1>
1673
+ <p>A</p>
1674
+ <div id='C1'>
1675
+ <h2>
1676
+ 1.1.
1677
+ <span style='mso-tab-count:1'>&#160; </span>
1678
+ Introduction Subsection
1679
+ </h2>
1680
+ <p>B</p>
1681
+ <div id='C2'>
1682
+ <h3>
1683
+ 1.1.1.
1684
+ <span style='mso-tab-count:1'>&#160; </span>
1685
+ Introduction Sub-subsection
1686
+ </h3>
1687
+ <p>C</p>
1688
+ </div>
1689
+ </div>
1690
+ </div>
1691
+ <div id='C4'>
1692
+ <p>D</p>
1693
+ <h1>
1694
+ 2.
1695
+ <span style='mso-tab-count:1'>&#160; </span>
1696
+ Clause 2
1697
+ </h1>
1698
+ </div>
1699
+ </div>
1700
+ </body>
1701
+ </html>
1702
+ OUTPUT
1703
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1704
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1705
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
1706
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1707
+ expect(xmlpp(IsoDoc::WordConvert.new({})
1708
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
1492
1709
  end
1493
1710
 
1494
1711
  it "processes section titles without ID" do
@@ -1780,7 +1997,7 @@ RSpec.describe IsoDoc do
1780
1997
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1781
1998
  end
1782
1999
 
1783
- it "processes annexes containing one, or more than one special sections" do
2000
+ it "processes annexes containing one, or more than one special sections" do
1784
2001
  input = <<~INPUT
1785
2002
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1786
2003
  <annex id='PP' obligation='normative'>
@@ -1821,87 +2038,87 @@ RSpec.describe IsoDoc do
1821
2038
  </iso-standard>
1822
2039
  INPUT
1823
2040
  presxml = <<~OUTPUT
1824
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1825
- <annex id='PP' obligation='normative' displayorder='1'>
1826
- <title>
1827
- <strong>Annex A</strong>
1828
- <br/>
1829
- (normative)
1830
- <br/>
1831
- <br/>
1832
- <strong>Glossary</strong>
1833
- </title>
1834
- <terms id='PP1' obligation='normative'>
1835
- <title>A.</title>
1836
- <term id='term-glossary'>
1837
- <name>A.1.</name>
1838
- <preferred><strong>Glossary</strong></preferred>
1839
- </term>
1840
- </terms>
1841
- </annex>
1842
- <annex id='QQ' obligation='normative' displayorder='2'>
1843
- <title>
1844
- <strong>Annex B</strong>
1845
- <br/>
1846
- (normative)
1847
- <br/>
1848
- <br/>
1849
- <strong>Glossary</strong>
1850
- </title>
1851
- <terms id='QQ1' obligation='normative'>
1852
- <title depth='2'>
1853
- B.1.
1854
- <tab/>
1855
- Term Collection
1856
- </title>
1857
- <term id='term-term-1'>
1858
- <name>B.1.1.</name>
1859
- <preferred><strong>Term</strong></preferred>
1860
- </term>
1861
- </terms>
1862
- <terms id='QQ2' obligation='normative'>
1863
- <title depth='2'>
1864
- B.2.
1865
- <tab/>
1866
- Term Collection 2
1867
- </title>
1868
- <term id='term-term-2'>
1869
- <name>B.2.1.</name>
1870
- <preferred><strong>Term</strong></preferred>
1871
- </term>
1872
- </terms>
1873
- </annex>
1874
- <annex id='RR' obligation='normative' displayorder='3'>
1875
- <title>
1876
- <strong>Annex C</strong>
1877
- <br/>
1878
- (normative)
1879
- <br/>
1880
- <br/>
1881
- <strong>Glossary</strong>
1882
- </title>
1883
- <terms id='RR1' obligation='normative'>
1884
- <title depth='2'>
1885
- C.1.
1886
- <tab/>
1887
- Term Collection
1888
- </title>
1889
- <term id='term-term-3'>
1890
- <name>C.1.1.</name>
1891
- <preferred><strong>Term</strong></preferred>
1892
- </term>
1893
- </terms>
1894
- <references id='RR2' obligation='normative'>
1895
- <title depth='2'>
1896
- C.2.
1897
- <tab/>
1898
- References
1899
- </title>
1900
- </references>
1901
- </annex>
1902
- </iso-standard>
2041
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2042
+ <annex id='PP' obligation='normative' displayorder='1'>
2043
+ <title>
2044
+ <strong>Annex A</strong>
2045
+ <br/>
2046
+ (normative)
2047
+ <br/>
2048
+ <br/>
2049
+ <strong>Glossary</strong>
2050
+ </title>
2051
+ <terms id='PP1' obligation='normative'>
2052
+ <title>A.</title>
2053
+ <term id='term-glossary'>
2054
+ <name>A.1.</name>
2055
+ <preferred><strong>Glossary</strong></preferred>
2056
+ </term>
2057
+ </terms>
2058
+ </annex>
2059
+ <annex id='QQ' obligation='normative' displayorder='2'>
2060
+ <title>
2061
+ <strong>Annex B</strong>
2062
+ <br/>
2063
+ (normative)
2064
+ <br/>
2065
+ <br/>
2066
+ <strong>Glossary</strong>
2067
+ </title>
2068
+ <terms id='QQ1' obligation='normative'>
2069
+ <title depth='2'>
2070
+ B.1.
2071
+ <tab/>
2072
+ Term Collection
2073
+ </title>
2074
+ <term id='term-term-1'>
2075
+ <name>B.1.1.</name>
2076
+ <preferred><strong>Term</strong></preferred>
2077
+ </term>
2078
+ </terms>
2079
+ <terms id='QQ2' obligation='normative'>
2080
+ <title depth='2'>
2081
+ B.2.
2082
+ <tab/>
2083
+ Term Collection 2
2084
+ </title>
2085
+ <term id='term-term-2'>
2086
+ <name>B.2.1.</name>
2087
+ <preferred><strong>Term</strong></preferred>
2088
+ </term>
2089
+ </terms>
2090
+ </annex>
2091
+ <annex id='RR' obligation='normative' displayorder='3'>
2092
+ <title>
2093
+ <strong>Annex C</strong>
2094
+ <br/>
2095
+ (normative)
2096
+ <br/>
2097
+ <br/>
2098
+ <strong>Glossary</strong>
2099
+ </title>
2100
+ <terms id='RR1' obligation='normative'>
2101
+ <title depth='2'>
2102
+ C.1.
2103
+ <tab/>
2104
+ Term Collection
2105
+ </title>
2106
+ <term id='term-term-3'>
2107
+ <name>C.1.1.</name>
2108
+ <preferred><strong>Term</strong></preferred>
2109
+ </term>
2110
+ </terms>
2111
+ <references id='RR2' obligation='normative'>
2112
+ <title depth='2'>
2113
+ C.2.
2114
+ <tab/>
2115
+ References
2116
+ </title>
2117
+ </references>
2118
+ </annex>
2119
+ </iso-standard>
1903
2120
  OUTPUT
1904
2121
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1905
2122
  .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1906
- end
2123
+ end
1907
2124
  end