isodoc 1.8.3.2 → 2.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -31
- data/Gemfile +0 -1
- data/lib/isodoc/base_style/all.css +9 -0
- data/lib/isodoc/base_style/reset.css +9 -0
- data/lib/isodoc/base_style/reset.scss +11 -0
- data/lib/isodoc/class_utils.rb +18 -6
- data/lib/isodoc/convert.rb +8 -1
- data/lib/isodoc/function/blocks.rb +4 -1
- data/lib/isodoc/function/references.rb +32 -23
- data/lib/isodoc/function/section_titles.rb +6 -1
- data/lib/isodoc/function/to_word_html.rb +3 -3
- data/lib/isodoc/function/utils.rb +13 -14
- data/lib/isodoc/headlesshtml_convert.rb +1 -1
- data/lib/isodoc/html_convert.rb +1 -1
- data/lib/isodoc/html_function/postprocess.rb +9 -2
- data/lib/isodoc/i18n.rb +6 -3
- data/lib/isodoc/pdf_convert.rb +1 -1
- data/lib/isodoc/presentation_function/bibdata.rb +0 -6
- data/lib/isodoc/presentation_function/section.rb +40 -4
- data/lib/isodoc/presentation_function/terms.rb +25 -20
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_sect_gen.rb +7 -3
- data/lib/isodoc/xslfo_convert.rb +1 -5
- data/spec/isodoc/blocks_spec.rb +3 -2
- data/spec/isodoc/postproc_spec.rb +46 -16
- data/spec/isodoc/presentation_xml_spec.rb +208 -37
- data/spec/isodoc/ref_spec.rb +332 -300
- data/spec/isodoc/section_spec.rb +713 -601
- data/spec/isodoc/utils_spec.rb +57 -0
- metadata +7 -6
data/spec/isodoc/section_spec.rb
CHANGED
@@ -812,526 +812,530 @@ RSpec.describe IsoDoc do
|
|
812
812
|
</iso-standard>
|
813
813
|
INPUT
|
814
814
|
html = <<~OUTPUT
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
815
|
+
<html lang='en'>
|
816
|
+
<head/>
|
817
|
+
<body lang='en'>
|
818
|
+
<div class='title-section'>
|
819
|
+
<p> </p>
|
820
|
+
</div>
|
821
|
+
<br/>
|
822
|
+
<div class='prefatory-section'>
|
823
|
+
<p> </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
|
+
  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.  Scope
|
899
|
+
<br/>
|
900
|
+
<br/>
|
901
|
+
Variant 1
|
902
|
+
</h1>
|
903
|
+
<p id='E'>Text</p>
|
904
|
+
</div>
|
905
|
+
<div>
|
906
|
+
<h1>
|
907
|
+
2.  Normative References
|
908
|
+
<br/>
|
909
|
+
<br/>
|
910
|
+
Variant 1
|
911
|
+
</h1>
|
912
|
+
</div>
|
913
|
+
<div id='H'>
|
914
|
+
<h1>
|
915
|
+
3.  Terms, Definitions, Symbols and Abbreviated Terms
|
916
|
+
<br/>
|
917
|
+
<br/>
|
918
|
+
Variant 1
|
919
|
+
</h1>
|
920
|
+
<div id='I'>
|
921
|
+
<h2>
|
922
|
+
3.1.  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.  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.  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.  Clause 4
|
962
|
+
<br/>
|
963
|
+
<br/>
|
964
|
+
Variant 1
|
965
|
+
</h1>
|
966
|
+
<div id='N'>
|
967
|
+
<h2>
|
968
|
+
5.1.  Introduction
|
969
|
+
<br/>
|
970
|
+
<br/>
|
971
|
+
Variant 1
|
972
|
+
</h2>
|
973
|
+
</div>
|
974
|
+
<div id='O'>
|
975
|
+
<h2>
|
976
|
+
5.2.  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.  Annex A.1
|
1003
|
+
<br/>
|
1004
|
+
<br/>
|
1005
|
+
Variant 1
|
1006
|
+
</h2>
|
1007
|
+
<div id='Q1'>
|
1008
|
+
<h3>
|
1009
|
+
A.1.1.  Annex A.1a
|
1010
|
+
<br/>
|
1011
|
+
<br/>
|
1012
|
+
Variant 1
|
1013
|
+
</h3>
|
1014
|
+
</div>
|
1015
|
+
<div>
|
1016
|
+
<h3 class='Section3'>
|
1017
|
+
A.1.2.  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
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
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> </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> </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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'>  </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
|
1491
|
-
.
|
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> </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> </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
|
-
|
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
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
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
|
-
|
2018
|
+
end
|
1907
2019
|
end
|