isodoc 1.8.3.2 → 2.0.0.1

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.
@@ -812,526 +812,530 @@ RSpec.describe IsoDoc do
812
812
  </iso-standard>
813
813
  INPUT
814
814
  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>
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
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1000
+ <div id='Q'>
1001
+ <h2>
1002
+ A.1.&#160; Annex A.1
1003
+ <br/>
1004
+ <br/>
1005
+ Variant 1
1006
+ </h2>
1007
+ <div id='Q1'>
1008
+ <h3>
1009
+ A.1.1.&#160; Annex A.1a
1010
+ <br/>
1011
+ <br/>
1012
+ Variant 1
1013
+ </h3>
1014
+ </div>
1015
+ <div>
1016
+ <h3 class='Section3'>
1017
+ A.1.2.&#160; Annex Bibliography
1018
+ <br/>
1019
+ <br/>
1020
+ Variant 1
1021
+ </h3>
1022
+ </div>
1023
+ </div>
1024
+ </div>
1025
+ <br/>
1026
+ <div id='P1' class='Section3'>
1027
+ <h1 class='Annex'>
1028
+ <b>Annex B</b>
1029
+ <br/>
1030
+ (normative)
1031
+ </h1>
1032
+ </div>
1033
+ <br/>
1034
+ <div>
1035
+ <h1 class='Section3'>Bibliography</h1>
1036
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1037
+ <div>
1038
+ <h2 class='Section3'>
1039
+ Bibliography Subsection
1040
+ <br/>
1041
+ <br/>
1042
+ Variant 1
1043
+ </h2>
1044
+ </div>
1045
+ </div>
1046
+ </div>
1047
+ </body>
1048
+ </html>
1047
1049
  OUTPUT
1048
1050
  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>
1051
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1052
+ <head>
1053
+ <style>
1054
+ </style>
1055
+ </head>
1056
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1057
+ <div class='WordSection1'>
1058
+ <p>&#160;</p>
1059
+ </div>
1060
+ <p>
1061
+ <br clear='all' class='section'/>
1062
+ </p>
1063
+ <div class='WordSection2'>
1064
+ <p>
1065
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1066
+ </p>
1067
+ <div>
1068
+ <h1 class='AbstractTitle'>
1069
+ Abstract
1070
+ <br/>
1071
+ <br/>
1072
+ Variant 1
1073
+ </h1>
1074
+ </div>
1075
+ <p>
1076
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1077
+ </p>
1078
+ <div>
1079
+ <h1 class='ForewordTitle'>
1080
+ Foreword
1081
+ <br/>
1082
+ <br/>
1083
+ Variant 1
1084
+ </h1>
1085
+ <p id='A'>This is a preamble</p>
1086
+ </div>
1087
+ <p>
1088
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1089
+ </p>
1090
+ <div class='Section3' id='B'>
1091
+ <h1 class='IntroTitle'>Introduction</h1>
1092
+ <div id='C'>
1093
+ <h2>
1094
+ Introduction Subsection
1095
+ <br/>
1096
+ <br/>
1097
+ Variant 1
1098
+ </h2>
1099
+ </div>
1100
+ </div>
1101
+ <p>
1102
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1103
+ </p>
1104
+ <div class='Section3' id='B1'>
1105
+ <h1 class='IntroTitle'>
1106
+ Dedication
1107
+ <br/>
1108
+ <br/>
1109
+ Variant 1
1110
+ </h1>
1111
+ </div>
1112
+ <p>
1113
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1114
+ </p>
1115
+ <div class='Section3' id='B2'>
1116
+ <h1 class='IntroTitle'>
1117
+ Note to reader
1118
+ <br/>
1119
+ <br/>
1120
+ Variant 1
1121
+ </h1>
1122
+ </div>
1123
+ <p>
1124
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1125
+ </p>
1126
+ <div class='Section3' id=''>
1127
+ <h1 class='IntroTitle'>
1128
+ Acknowledgements
1129
+ <br/>
1130
+ <br/>
1131
+ Variant 1
1132
+ </h1>
1133
+ </div>
1134
+ <p>&#160;</p>
1135
+ </div>
1136
+ <p>
1137
+ <br clear='all' class='section'/>
1138
+ </p>
1139
+ <div class='WordSection3'>
1140
+ <p class='zzSTDTitle1'/>
1141
+ <div id='NN1' class='Note'>
1142
+ <p class='Note'>
1143
+ <span class='note_label'>NOTE</span>
1144
+ <span style='mso-tab-count:1'>&#160; </span>
1145
+ Initial note
1146
+ </p>
1147
+ </div>
1148
+ <div id='NN2' class='Admonition'>
1149
+ <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
1150
+ <p>Initial admonition</p>
1151
+ </div>
1152
+ <div id='D'>
1153
+ <h1>
1154
+ 1.
1155
+ <span style='mso-tab-count:1'>&#160; </span>
1156
+ Scope
1157
+ <br/>
1158
+ <br/>
1159
+ Variant 1
1160
+ </h1>
1161
+ <p id='E'>Text</p>
1162
+ </div>
1163
+ <div>
1164
+ <h1>
1165
+ 2.
1166
+ <span style='mso-tab-count:1'>&#160; </span>
1167
+ Normative References
1168
+ <br/>
1169
+ <br/>
1170
+ Variant 1
1171
+ </h1>
1172
+ </div>
1173
+ <div id='H'>
1174
+ <h1>
1175
+ 3.
1176
+ <span style='mso-tab-count:1'>&#160; </span>
1177
+ Terms, Definitions, Symbols and Abbreviated Terms
1178
+ <br/>
1179
+ <br/>
1180
+ Variant 1
1181
+ </h1>
1182
+ <div id='I'>
1183
+ <h2>
1184
+ 3.1.
1185
+ <span style='mso-tab-count:1'>&#160; </span>
1186
+ Normal Terms
1187
+ <br/>
1188
+ <br/>
1189
+ Variant 1
1190
+ </h2>
1191
+ <p class='TermNum' id='J'>3.1.1.</p>
1192
+ <p class='Terms' style='text-align:left;'><b>Term2</b></p>
1193
+ </div>
1194
+ <div id='K'>
1195
+ <h2>
1196
+ 3.2.
1197
+ <span style='mso-tab-count:1'>&#160; </span>
1198
+ Definitions
1199
+ <br/>
1200
+ <br/>
1201
+ Variant 1
1202
+ </h2>
1203
+ <table class='dl'>
1204
+ <tr>
1205
+ <td valign='top' align='left'>
1206
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1207
+ </td>
1208
+ <td valign='top'>Definition</td>
1209
+ </tr>
1210
+ </table>
1211
+ </div>
1212
+ </div>
1213
+ <div id='L' class='Symbols'>
1214
+ <h1>
1215
+ 4.
1216
+ <span style='mso-tab-count:1'>&#160; </span>
1217
+ Symbols and abbreviated terms
1218
+ <br/>
1219
+ <br/>
1220
+ Variant 1
1221
+ </h1>
1222
+ <table class='dl'>
1223
+ <tr>
1224
+ <td valign='top' align='left'>
1225
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1226
+ </td>
1227
+ <td valign='top'>Definition</td>
1228
+ </tr>
1229
+ </table>
1230
+ </div>
1231
+ <div id='M'>
1232
+ <h1>
1233
+ 5.
1234
+ <span style='mso-tab-count:1'>&#160; </span>
1235
+ Clause 4
1236
+ <br/>
1237
+ <br/>
1238
+ Variant 1
1239
+ </h1>
1240
+ <div id='N'>
1241
+ <h2>
1242
+ 5.1.
1243
+ <span style='mso-tab-count:1'>&#160; </span>
1244
+ Introduction
1245
+ <br/>
1246
+ <br/>
1247
+ Variant 1
1248
+ </h2>
1249
+ </div>
1250
+ <div id='O'>
1251
+ <h2>
1252
+ 5.2.
1253
+ <span style='mso-tab-count:1'>&#160; </span>
1254
+ Clause 4.2
1255
+ <br/>
1256
+ <br/>
1257
+ Variant 1
1258
+ </h2>
1259
+ </div>
1260
+ <div id='O1'>
1261
+ <h2>5.3.</h2>
1262
+ </div>
1263
+ </div>
1264
+ <p>
1265
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1266
+ </p>
1267
+ <div id='P' class='Section3'>
1268
+ <h1 class='Annex'>
1269
+ <b>Annex A</b>
1270
+ <br/>
1271
+ (normative)
1272
+ <br/>
1273
+ <br/>
1274
+ <b>Annex</b>
1275
+ <br/>
1276
+ <br/>
1277
+ Variant 1
1278
+ </h1>
1279
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1280
+ <div id='Q'>
1281
+ <h2>
1282
+ A.1.
1283
+ <span style='mso-tab-count:1'>&#160; </span>
1284
+ Annex A.1
1285
+ <br/>
1286
+ <br/>
1287
+ Variant 1
1288
+ </h2>
1289
+ <div id='Q1'>
1290
+ <h3>
1291
+ A.1.1.
1292
+ <span style='mso-tab-count:1'>&#160; </span>
1293
+ Annex A.1a
1294
+ <br/>
1295
+ <br/>
1296
+ Variant 1
1297
+ </h3>
1298
+ </div>
1299
+ <div>
1300
+ <h3 class='Section3'>
1301
+ A.1.2.
1302
+ <span style='mso-tab-count:1'>&#160; </span>
1303
+ Annex Bibliography
1304
+ <br/>
1305
+ <br/>
1306
+ Variant 1
1307
+ </h3>
1308
+ </div>
1309
+ </div>
1310
+ </div>
1311
+ <p>
1312
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1313
+ </p>
1314
+ <div id='P1' class='Section3'>
1315
+ <h1 class='Annex'>
1316
+ <b>Annex B</b>
1317
+ <br/>
1318
+ (normative)
1319
+ </h1>
1320
+ </div>
1321
+ <p>
1322
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1323
+ </p>
1324
+ <div>
1325
+ <h1 class='Section3'>Bibliography</h1>
1326
+ <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1327
+ <div>
1328
+ <h2 class='Section3'>
1329
+ Bibliography Subsection
1330
+ <br/>
1331
+ <br/>
1332
+ Variant 1
1333
+ </h2>
1334
+ </div>
1335
+ </div>
1336
+ </div>
1337
+ </body>
1338
+ </html>
1335
1339
  OUTPUT
1336
1340
  presxml = IsoDoc::PresentationXMLConvert.new({})
1337
1341
  .convert("test", input, true)
@@ -1487,8 +1491,116 @@ RSpec.describe IsoDoc do
1487
1491
  </bibliography>
1488
1492
  </iso-standard>
1489
1493
  OUTPUT
1490
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
1491
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1494
+ expect(xmlpp(IsoDoc::PresentationXMLConvert
1495
+ .new({ suppressheadingnumbers: true })
1496
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1497
+ end
1498
+
1499
+ it "processes floating titles" do
1500
+ input = <<~INPUT
1501
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1502
+ <preface>
1503
+ <introduction id="B" obligation="informative">
1504
+ <title>Introduction</title>
1505
+ <floating-title depth="1">A</p>
1506
+ <clause id="B1" obligation="informative">
1507
+ <title>Introduction Subsection</title>
1508
+ <floating-title depth="2">B</p>
1509
+ <clause id="B2" obligation="informative">
1510
+ <title>Introduction Sub-subsection</title>
1511
+ <floating-title depth="1">C</p>
1512
+ </clause>
1513
+ </clause>
1514
+ </introduction>
1515
+ </preface>
1516
+ </iso-standard>
1517
+ INPUT
1518
+
1519
+ presxml = <<~PRESXML
1520
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1521
+ <preface>
1522
+ <introduction id='B' obligation='informative' displayorder='1'>
1523
+ <title>Introduction</title>
1524
+ <p depth='1' type='floating-title'>A</p>
1525
+ <clause id='B1' obligation='informative'>
1526
+ <title depth='2'>Introduction Subsection</title>
1527
+ <p type='floating-title' depth="2">B</p>
1528
+ <clause id='B2' obligation='informative'>
1529
+ <title depth='3'>Introduction Sub-subsection</title>
1530
+ <p depth='1' type='floating-title'>C</p>
1531
+ </clause>
1532
+ </clause>
1533
+ </introduction>
1534
+ </preface>
1535
+ </iso-standard>
1536
+ PRESXML
1537
+
1538
+ html = <<~OUTPUT
1539
+ #{HTML_HDR}
1540
+ <br/>
1541
+ <div class='Section3' id='B'>
1542
+ <h1 class='IntroTitle'>Introduction</h1>
1543
+ <p class='h1'>A</p>
1544
+ <div id='B1'>
1545
+ <h2>Introduction Subsection</h2>
1546
+ <p class='h2'>B</p>
1547
+ <div id='B2'>
1548
+ <h3>Introduction Sub-subsection</h3>
1549
+ <p class='h1'>C</p>
1550
+ </div>
1551
+ </div>
1552
+ </div>
1553
+ <p class='zzSTDTitle1'/>
1554
+ </div>
1555
+ </body>
1556
+ </html>
1557
+ OUTPUT
1558
+
1559
+ word = <<~OUTPUT
1560
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1561
+ <head>
1562
+ <style></style>
1563
+ </head>
1564
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1565
+ <div class='WordSection1'>
1566
+ <p>&#160;</p>
1567
+ </div>
1568
+ <p>
1569
+ <br clear='all' class='section'/>
1570
+ </p>
1571
+ <div class='WordSection2'>
1572
+ <p>
1573
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1574
+ </p>
1575
+ <div class='Section3' id='B'>
1576
+ <h1 class='IntroTitle'>Introduction</h1>
1577
+ <p>A</p>
1578
+ <div id='B1'>
1579
+ <h2>Introduction Subsection</h2>
1580
+ <p>B</p>
1581
+ <div id='B2'>
1582
+ <h3>Introduction Sub-subsection</h3>
1583
+ <p>C</p>
1584
+ </div>
1585
+ </div>
1586
+ </div>
1587
+ <p>&#160;</p>
1588
+ </div>
1589
+ <p>
1590
+ <br clear='all' class='section'/>
1591
+ </p>
1592
+ <div class='WordSection3'>
1593
+ <p class='zzSTDTitle1'/>
1594
+ </div>
1595
+ </body>
1596
+ </html>
1597
+ OUTPUT
1598
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1599
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1600
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
1601
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1602
+ expect(xmlpp(IsoDoc::WordConvert.new({})
1603
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
1492
1604
  end
1493
1605
 
1494
1606
  it "processes section titles without ID" do
@@ -1780,7 +1892,7 @@ RSpec.describe IsoDoc do
1780
1892
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1781
1893
  end
1782
1894
 
1783
- it "processes annexes containing one, or more than one special sections" do
1895
+ it "processes annexes containing one, or more than one special sections" do
1784
1896
  input = <<~INPUT
1785
1897
  <iso-standard xmlns="http://riboseinc.com/isoxml">
1786
1898
  <annex id='PP' obligation='normative'>
@@ -1821,87 +1933,87 @@ RSpec.describe IsoDoc do
1821
1933
  </iso-standard>
1822
1934
  INPUT
1823
1935
  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>
1936
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1937
+ <annex id='PP' obligation='normative' displayorder='1'>
1938
+ <title>
1939
+ <strong>Annex A</strong>
1940
+ <br/>
1941
+ (normative)
1942
+ <br/>
1943
+ <br/>
1944
+ <strong>Glossary</strong>
1945
+ </title>
1946
+ <terms id='PP1' obligation='normative'>
1947
+ <title>A.</title>
1948
+ <term id='term-glossary'>
1949
+ <name>A.1.</name>
1950
+ <preferred><strong>Glossary</strong></preferred>
1951
+ </term>
1952
+ </terms>
1953
+ </annex>
1954
+ <annex id='QQ' obligation='normative' displayorder='2'>
1955
+ <title>
1956
+ <strong>Annex B</strong>
1957
+ <br/>
1958
+ (normative)
1959
+ <br/>
1960
+ <br/>
1961
+ <strong>Glossary</strong>
1962
+ </title>
1963
+ <terms id='QQ1' obligation='normative'>
1964
+ <title depth='2'>
1965
+ B.1.
1966
+ <tab/>
1967
+ Term Collection
1968
+ </title>
1969
+ <term id='term-term-1'>
1970
+ <name>B.1.1.</name>
1971
+ <preferred><strong>Term</strong></preferred>
1972
+ </term>
1973
+ </terms>
1974
+ <terms id='QQ2' obligation='normative'>
1975
+ <title depth='2'>
1976
+ B.2.
1977
+ <tab/>
1978
+ Term Collection 2
1979
+ </title>
1980
+ <term id='term-term-2'>
1981
+ <name>B.2.1.</name>
1982
+ <preferred><strong>Term</strong></preferred>
1983
+ </term>
1984
+ </terms>
1985
+ </annex>
1986
+ <annex id='RR' obligation='normative' displayorder='3'>
1987
+ <title>
1988
+ <strong>Annex C</strong>
1989
+ <br/>
1990
+ (normative)
1991
+ <br/>
1992
+ <br/>
1993
+ <strong>Glossary</strong>
1994
+ </title>
1995
+ <terms id='RR1' obligation='normative'>
1996
+ <title depth='2'>
1997
+ C.1.
1998
+ <tab/>
1999
+ Term Collection
2000
+ </title>
2001
+ <term id='term-term-3'>
2002
+ <name>C.1.1.</name>
2003
+ <preferred><strong>Term</strong></preferred>
2004
+ </term>
2005
+ </terms>
2006
+ <references id='RR2' obligation='normative'>
2007
+ <title depth='2'>
2008
+ C.2.
2009
+ <tab/>
2010
+ References
2011
+ </title>
2012
+ </references>
2013
+ </annex>
2014
+ </iso-standard>
1903
2015
  OUTPUT
1904
2016
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1905
2017
  .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1906
- end
2018
+ end
1907
2019
  end