isodoc 2.0.8.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +4 -2
- data/lib/isodoc/convert.rb +1 -1
- data/lib/isodoc/function/blocks.rb +0 -39
- data/lib/isodoc/function/blocks_example_note.rb +36 -1
- data/lib/isodoc/function/inline.rb +4 -0
- data/lib/isodoc/function/references.rb +2 -15
- data/lib/isodoc/function/section.rb +5 -0
- data/lib/isodoc/function/to_word_html.rb +7 -11
- data/lib/isodoc/html_function/postprocess.rb +16 -2
- data/lib/isodoc/metadata.rb +2 -1
- data/lib/isodoc/presentation_function/bibdata.rb +30 -4
- data/lib/isodoc/presentation_function/block.rb +13 -1
- data/lib/isodoc/presentation_function/section.rb +36 -0
- data/lib/isodoc/presentation_xml_convert.rb +7 -2
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/postprocess.rb +3 -4
- data/lib/isodoc/word_function/postprocess_cover.rb +14 -0
- data/lib/isodoc/word_function/table.rb +12 -10
- data/lib/isodoc/xref/xref_anchor.rb +1 -1
- data/lib/isodoc/xref/xref_counter.rb +4 -1
- data/lib/isodoc/xref/xref_gen_seq.rb +3 -3
- data/lib/isodoc/xref/xref_sect_gen.rb +34 -36
- data/lib/isodoc/xref.rb +19 -8
- data/lib/isodoc-yaml/i18n-ar.yaml +9 -0
- data/lib/isodoc-yaml/i18n-de.yaml +13 -0
- data/lib/isodoc-yaml/i18n-en.yaml +5 -0
- data/lib/isodoc-yaml/i18n-es.yaml +11 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +12 -1
- data/lib/isodoc-yaml/i18n-ru.yaml +13 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +5 -0
- data/lib/relaton/render/config.yml +4 -0
- data/lib/relaton/render/general.rb +35 -0
- data/spec/assets/i18n.yaml +6 -0
- data/spec/isodoc/blocks_spec.rb +249 -61
- data/spec/isodoc/i18n_spec.rb +266 -197
- data/spec/isodoc/inline_spec.rb +80 -106
- data/spec/isodoc/metadata_spec.rb +5 -3
- data/spec/isodoc/postproc_spec.rb +539 -397
- data/spec/isodoc/ref_spec.rb +52 -98
- data/spec/isodoc/section_spec.rb +4 -4
- data/spec/isodoc/xref_numbering_spec.rb +31 -0
- metadata +24 -8
@@ -492,10 +492,10 @@ RSpec.describe IsoDoc do
|
|
492
492
|
</sections>
|
493
493
|
</iso-standard>
|
494
494
|
INPUT
|
495
|
-
html = Nokogiri::XML(File.read("test.html"))
|
496
|
-
at("//div[@id = 'toc']")
|
495
|
+
html = Nokogiri::XML(File.read("test.html"))
|
496
|
+
.at("//div[@id = 'toc']")
|
497
497
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~OUTPUT)
|
498
|
-
|
498
|
+
HAJSHJAS
|
499
499
|
OUTPUT
|
500
500
|
end
|
501
501
|
|
@@ -721,120 +721,120 @@ RSpec.describe IsoDoc do
|
|
721
721
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
722
722
|
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
|
723
723
|
.to be_equivalent_to xmlpp(<<~'OUTPUT')
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
724
|
+
<div class='WordSection2'>
|
725
|
+
/* an empty word intro page */
|
726
|
+
<p class='MsoToc1'>
|
727
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
728
|
+
<span style='mso-element:field-begin'/>
|
729
|
+
<span style='mso-spacerun:yes'> </span>
|
730
|
+
TOC \o "1-3" \h \z \u
|
731
|
+
<span style='mso-element:field-separator'/>
|
732
|
+
</span>
|
733
|
+
<span class='MsoHyperlink'>
|
734
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
735
|
+
<a href='#_Toc'>
|
736
|
+
Clause 4
|
737
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
738
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
739
|
+
</span>
|
740
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
741
|
+
<span style='mso-element:field-begin'/>
|
742
|
+
</span>
|
743
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
744
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
745
|
+
<span style='mso-element:field-separator'/>
|
746
|
+
</span>
|
747
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
748
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
749
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
750
|
+
<span style='mso-element:field-end'/>
|
751
|
+
</span>
|
752
|
+
</a>
|
753
|
+
</span>
|
754
|
+
</span>
|
755
|
+
</p>
|
756
|
+
<p class='MsoToc2'>
|
757
|
+
<span class='MsoHyperlink'>
|
758
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
759
|
+
<a href='#_Toc'>
|
760
|
+
Introduction to this
|
761
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
762
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
763
|
+
</span>
|
764
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
765
|
+
<span style='mso-element:field-begin'/>
|
766
|
+
</span>
|
767
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
768
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
769
|
+
<span style='mso-element:field-separator'/>
|
770
|
+
</span>
|
771
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
772
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
773
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
774
|
+
<span style='mso-element:field-end'/>
|
775
|
+
</span>
|
776
|
+
</a>
|
777
|
+
</span>
|
778
|
+
</span>
|
779
|
+
</p>
|
780
|
+
<p class='MsoToc2'>
|
781
|
+
<span class='MsoHyperlink'>
|
782
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
783
|
+
<a href='#_Toc'>
|
784
|
+
Clause 4.2
|
785
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
786
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
787
|
+
</span>
|
788
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
789
|
+
<span style='mso-element:field-begin'/>
|
790
|
+
</span>
|
791
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
792
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
793
|
+
<span style='mso-element:field-separator'/>
|
794
|
+
</span>
|
795
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
796
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
797
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
798
|
+
<span style='mso-element:field-end'/>
|
799
|
+
</span>
|
800
|
+
</a>
|
801
|
+
</span>
|
802
|
+
</span>
|
803
|
+
</p>
|
804
|
+
<p class='MsoToc3'>
|
805
|
+
<span class='MsoHyperlink'>
|
806
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
807
|
+
<a href='#_Toc'>
|
808
|
+
Clause 4.2.1
|
809
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
810
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
811
|
+
</span>
|
812
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
813
|
+
<span style='mso-element:field-begin'/>
|
814
|
+
</span>
|
815
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
816
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
817
|
+
<span style='mso-element:field-separator'/>
|
818
|
+
</span>
|
819
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
820
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
821
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
822
|
+
<span style='mso-element:field-end'/>
|
823
|
+
</span>
|
824
|
+
</a>
|
825
|
+
</span>
|
826
|
+
</span>
|
827
|
+
</p>
|
828
|
+
<p class='MsoToc1'>
|
829
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
830
|
+
<span style='mso-element:field-end'/>
|
831
|
+
</span>
|
832
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
833
|
+
<p class='MsoNormal'> </p>
|
834
|
+
</span>
|
835
|
+
</p>
|
836
|
+
<p class='MsoNormal'> </p>
|
837
|
+
</div>
|
838
838
|
OUTPUT
|
839
839
|
|
840
840
|
toc_input = input.sub(%r{<iso-standard xmlns="http://riboseinc.com/isoxml">},
|
@@ -858,286 +858,286 @@ RSpec.describe IsoDoc do
|
|
858
858
|
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
859
859
|
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc")))
|
860
860
|
.to be_equivalent_to xmlpp(<<~'OUTPUT')
|
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
|
-
|
1047
|
-
|
1048
|
-
|
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
|
-
|
861
|
+
<div class='WordSection2'>
|
862
|
+
/* an empty word intro page */
|
863
|
+
<p class='MsoToc1'>
|
864
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
865
|
+
<span style='mso-element:field-begin'/>
|
866
|
+
<span style='mso-spacerun:yes'> </span>
|
867
|
+
TOC \o "1-3" \h \z \u
|
868
|
+
<span style='mso-element:field-separator'/>
|
869
|
+
</span>
|
870
|
+
<span class='MsoHyperlink'>
|
871
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
872
|
+
<a href='#_Toc'>
|
873
|
+
Clause 4
|
874
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
875
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
876
|
+
</span>
|
877
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
878
|
+
<span style='mso-element:field-begin'/>
|
879
|
+
</span>
|
880
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
881
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
882
|
+
<span style='mso-element:field-separator'/>
|
883
|
+
</span>
|
884
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
885
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
886
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
887
|
+
<span style='mso-element:field-end'/>
|
888
|
+
</span>
|
889
|
+
</a>
|
890
|
+
</span>
|
891
|
+
</span>
|
892
|
+
</p>
|
893
|
+
<p class='MsoToc2'>
|
894
|
+
<span class='MsoHyperlink'>
|
895
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
896
|
+
<a href='#_Toc'>
|
897
|
+
Introduction to this
|
898
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
899
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
900
|
+
</span>
|
901
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
902
|
+
<span style='mso-element:field-begin'/>
|
903
|
+
</span>
|
904
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
905
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
906
|
+
<span style='mso-element:field-separator'/>
|
907
|
+
</span>
|
908
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
909
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
910
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
911
|
+
<span style='mso-element:field-end'/>
|
912
|
+
</span>
|
913
|
+
</a>
|
914
|
+
</span>
|
915
|
+
</span>
|
916
|
+
</p>
|
917
|
+
<p class='MsoToc2'>
|
918
|
+
<span class='MsoHyperlink'>
|
919
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
920
|
+
<a href='#_Toc'>
|
921
|
+
Clause 4.2
|
922
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
923
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
924
|
+
</span>
|
925
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
926
|
+
<span style='mso-element:field-begin'/>
|
927
|
+
</span>
|
928
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
929
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
930
|
+
<span style='mso-element:field-separator'/>
|
931
|
+
</span>
|
932
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
933
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
934
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
935
|
+
<span style='mso-element:field-end'/>
|
936
|
+
</span>
|
937
|
+
</a>
|
938
|
+
</span>
|
939
|
+
</span>
|
940
|
+
</p>
|
941
|
+
<p class='MsoToc3'>
|
942
|
+
<span class='MsoHyperlink'>
|
943
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
944
|
+
<a href='#_Toc'>
|
945
|
+
Clause 4.2.1
|
946
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
947
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
948
|
+
</span>
|
949
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
950
|
+
<span style='mso-element:field-begin'/>
|
951
|
+
</span>
|
952
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
953
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
954
|
+
<span style='mso-element:field-separator'/>
|
955
|
+
</span>
|
956
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
957
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
958
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
959
|
+
<span style='mso-element:field-end'/>
|
960
|
+
</span>
|
961
|
+
</a>
|
962
|
+
</span>
|
963
|
+
</span>
|
964
|
+
</p>
|
965
|
+
<p class='MsoToc1'>
|
966
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
967
|
+
<span style='mso-element:field-end'/>
|
968
|
+
</span>
|
969
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
970
|
+
<p class='MsoNormal'> </p>
|
971
|
+
</span>
|
972
|
+
</p>
|
973
|
+
<p class='TOCTitle'>List of tables</p>
|
974
|
+
<p class='MsoToc1'>
|
975
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
976
|
+
<span style='mso-element:field-begin'/>
|
977
|
+
<span style='mso-spacerun:yes'> </span>
|
978
|
+
TOC \h \z \t "TableTitle,tabletitle"
|
979
|
+
<span style='mso-element:field-separator'/>
|
980
|
+
</span>
|
981
|
+
<span class='MsoHyperlink'>
|
982
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
983
|
+
<a href='#_Toc'>
|
984
|
+
First table
|
985
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
986
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
987
|
+
</span>
|
988
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
989
|
+
<span style='mso-element:field-begin'/>
|
990
|
+
</span>
|
991
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
992
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
993
|
+
<span style='mso-element:field-separator'/>
|
994
|
+
</span>
|
995
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
996
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
997
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
998
|
+
<span style='mso-element:field-end'/>
|
999
|
+
</span>
|
1000
|
+
</a>
|
1001
|
+
</span>
|
1002
|
+
</span>
|
1003
|
+
</p>
|
1004
|
+
<p class='MsoToc1'>
|
1005
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1006
|
+
<span style='mso-element:field-end'/>
|
1007
|
+
</span>
|
1008
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1009
|
+
<p class='MsoNormal'> </p>
|
1010
|
+
</span>
|
1011
|
+
</p>
|
1012
|
+
<p class='TOCTitle'>List of figures</p>
|
1013
|
+
<p class='MsoToc1'>
|
1014
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1015
|
+
<span style='mso-element:field-begin'/>
|
1016
|
+
<span style='mso-spacerun:yes'> </span>
|
1017
|
+
TOC \h \z \t "FigureTitle,figuretitle"
|
1018
|
+
<span style='mso-element:field-separator'/>
|
1019
|
+
</span>
|
1020
|
+
<span class='MsoHyperlink'>
|
1021
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
1022
|
+
<a href='#_Toc'>
|
1023
|
+
First figure
|
1024
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1025
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
1026
|
+
</span>
|
1027
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1028
|
+
<span style='mso-element:field-begin'/>
|
1029
|
+
</span>
|
1030
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
1031
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1032
|
+
<span style='mso-element:field-separator'/>
|
1033
|
+
</span>
|
1034
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
1035
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
1036
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1037
|
+
<span style='mso-element:field-end'/>
|
1038
|
+
</span>
|
1039
|
+
</a>
|
1040
|
+
</span>
|
1041
|
+
</span>
|
1042
|
+
</p>
|
1043
|
+
<p class='MsoToc1'>
|
1044
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1045
|
+
<span style='mso-element:field-end'/>
|
1046
|
+
</span>
|
1047
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1048
|
+
<p class='MsoNormal'> </p>
|
1049
|
+
</span>
|
1050
|
+
</p>
|
1051
|
+
<p class='TOCTitle'>List of recommendations</p>
|
1052
|
+
<p class='MsoToc1'>
|
1053
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1054
|
+
<span style='mso-element:field-begin'/>
|
1055
|
+
<span style='mso-spacerun:yes'> </span>
|
1056
|
+
TOC \h \z \t
|
1057
|
+
"RecommendationTitle,RecommendationTestTitle,recommendationtitle,recommendationtesttitle"
|
1058
|
+
<span style='mso-element:field-separator'/>
|
1059
|
+
</span>
|
1060
|
+
<span class='MsoHyperlink'>
|
1061
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
1062
|
+
<a href='#_Toc'>
|
1063
|
+
: /ogc/recommendation/wfs/2
|
1064
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1065
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
1066
|
+
</span>
|
1067
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1068
|
+
<span style='mso-element:field-begin'/>
|
1069
|
+
</span>
|
1070
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
1071
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1072
|
+
<span style='mso-element:field-separator'/>
|
1073
|
+
</span>
|
1074
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
1075
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
1076
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1077
|
+
<span style='mso-element:field-end'/>
|
1078
|
+
</span>
|
1079
|
+
</a>
|
1080
|
+
</span>
|
1081
|
+
</span>
|
1082
|
+
</p>
|
1083
|
+
<p class='MsoToc1'>
|
1084
|
+
<span class='MsoHyperlink'>
|
1085
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
1086
|
+
<a href='#_Toc'>
|
1087
|
+
Recommendation Verification 1: /ogc/recommendation/wfs/3
|
1088
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1089
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
1090
|
+
</span>
|
1091
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1092
|
+
<span style='mso-element:field-begin'/>
|
1093
|
+
</span>
|
1094
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
1095
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1096
|
+
<span style='mso-element:field-separator'/>
|
1097
|
+
</span>
|
1098
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
1099
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
1100
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1101
|
+
<span style='mso-element:field-end'/>
|
1102
|
+
</span>
|
1103
|
+
</a>
|
1104
|
+
</span>
|
1105
|
+
</span>
|
1106
|
+
</p>
|
1107
|
+
<p class='MsoToc1'>
|
1108
|
+
<span class='MsoHyperlink'>
|
1109
|
+
<span lang='EN-GB' xml:lang='EN-GB' style='mso-no-proof:yes'>
|
1110
|
+
<a href='#_Toc'>
|
1111
|
+
Recommendation Verification 2: /ogc/recommendation/wfs/3
|
1112
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1113
|
+
<span style='mso-tab-count:1 dotted'>. </span>
|
1114
|
+
</span>
|
1115
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1116
|
+
<span style='mso-element:field-begin'/>
|
1117
|
+
</span>
|
1118
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'> PAGEREF _Toc \h </span>
|
1119
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1120
|
+
<span style='mso-element:field-separator'/>
|
1121
|
+
</span>
|
1122
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>1</span>
|
1123
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'/>
|
1124
|
+
<span lang='EN-GB' xml:lang='EN-GB' class='MsoTocTextSpan'>
|
1125
|
+
<span style='mso-element:field-end'/>
|
1126
|
+
</span>
|
1127
|
+
</a>
|
1128
|
+
</span>
|
1129
|
+
</span>
|
1130
|
+
</p>
|
1131
|
+
<p class='MsoToc1'>
|
1132
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1133
|
+
<span style='mso-element:field-end'/>
|
1134
|
+
</span>
|
1135
|
+
<span lang='EN-GB' xml:lang='EN-GB'>
|
1136
|
+
<p class='MsoNormal'> </p>
|
1137
|
+
</span>
|
1138
|
+
</p>
|
1139
|
+
<p class='MsoNormal'> </p>
|
1140
|
+
</div>
|
1141
1141
|
OUTPUT
|
1142
1142
|
end
|
1143
1143
|
|
@@ -2099,6 +2099,148 @@ RSpec.describe IsoDoc do
|
|
2099
2099
|
.to be_equivalent_to xmlpp(doc)
|
2100
2100
|
end
|
2101
2101
|
|
2102
|
+
it "cleans up coverpage note" do
|
2103
|
+
input = <<~INPUT
|
2104
|
+
<html>
|
2105
|
+
<head/>
|
2106
|
+
<body>
|
2107
|
+
<div class="main-section">
|
2108
|
+
<div id='FB' class='Note' coverpage='true'>
|
2109
|
+
<p><span class='note_label'>NOTE</span>  XYZ</p>
|
2110
|
+
</div>
|
2111
|
+
<div id='FC' class='Admonition' coverpage='true'>
|
2112
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2113
|
+
<p>XYZ</p>
|
2114
|
+
</div>
|
2115
|
+
<hr/>
|
2116
|
+
<div id="coverpage-note-destination"/>
|
2117
|
+
</div>
|
2118
|
+
</body>
|
2119
|
+
</html>
|
2120
|
+
INPUT
|
2121
|
+
html = <<~OUTPUT
|
2122
|
+
<main class='main-section'>
|
2123
|
+
<button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
|
2124
|
+
<hr/>
|
2125
|
+
<div id='coverpage-note-destination'>
|
2126
|
+
<div id='FB' class='Note'>
|
2127
|
+
<p>
|
2128
|
+
<span class='note_label'>NOTE</span>
|
2129
|
+
  XYZ
|
2130
|
+
</p>
|
2131
|
+
</div>
|
2132
|
+
<div id='FC' class='Admonition'>
|
2133
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2134
|
+
<p>XYZ</p>
|
2135
|
+
</div>
|
2136
|
+
</div>
|
2137
|
+
</main>
|
2138
|
+
OUTPUT
|
2139
|
+
doc = <<~OUTPUT
|
2140
|
+
<html>
|
2141
|
+
<head/>
|
2142
|
+
<body>
|
2143
|
+
<div class='main-section'>
|
2144
|
+
<hr/>
|
2145
|
+
<div id='coverpage-note-destination'>
|
2146
|
+
<div id='FB' class='Note'>
|
2147
|
+
<p>
|
2148
|
+
<span class='note_label'>NOTE</span>
|
2149
|
+
  XYZ
|
2150
|
+
</p>
|
2151
|
+
</div>
|
2152
|
+
<div id='FC' class='Admonition'>
|
2153
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2154
|
+
<p>XYZ</p>
|
2155
|
+
</div>
|
2156
|
+
</div>
|
2157
|
+
</div>
|
2158
|
+
</body>
|
2159
|
+
</html>
|
2160
|
+
OUTPUT
|
2161
|
+
expect(xmlpp(IsoDoc::HtmlConvert
|
2162
|
+
.new(wordstylesheet: "spec/assets/word.css",
|
2163
|
+
htmlstylesheet: "spec/assets/html.scss", filename: "test")
|
2164
|
+
.html_preface(Nokogiri::XML(input)).to_xml)
|
2165
|
+
.sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>"))
|
2166
|
+
.to be_equivalent_to xmlpp(html)
|
2167
|
+
expect(xmlpp(IsoDoc::WordConvert
|
2168
|
+
.new(wordstylesheet: "spec/assets/word.css",
|
2169
|
+
htmlstylesheet: "spec/assets/html.scss", filename: "test")
|
2170
|
+
.word_cleanup(Nokogiri::XML(input)).to_xml)
|
2171
|
+
.sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>"))
|
2172
|
+
.to be_equivalent_to xmlpp(doc)
|
2173
|
+
end
|
2174
|
+
|
2175
|
+
it "removes coverpage note destination if unused" do
|
2176
|
+
input = <<~INPUT
|
2177
|
+
<html>
|
2178
|
+
<head/>
|
2179
|
+
<body>
|
2180
|
+
<div class="main-section">
|
2181
|
+
<div id='FB' class='Note'>
|
2182
|
+
<p><span class='note_label'>NOTE</span>  XYZ</p>
|
2183
|
+
</div>
|
2184
|
+
<div id='FC' class='Admonition'>
|
2185
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2186
|
+
<p>XYZ</p>
|
2187
|
+
</div>
|
2188
|
+
<hr/>
|
2189
|
+
<div id="coverpage-note-destination"/>
|
2190
|
+
</div>
|
2191
|
+
</body>
|
2192
|
+
</html>
|
2193
|
+
INPUT
|
2194
|
+
html = <<~OUTPUT
|
2195
|
+
<main class='main-section'>
|
2196
|
+
<button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
|
2197
|
+
<div id='FB' class='Note'>
|
2198
|
+
<p>
|
2199
|
+
<span class='note_label'>NOTE</span>
|
2200
|
+
  XYZ
|
2201
|
+
</p>
|
2202
|
+
</div>
|
2203
|
+
<div id='FC' class='Admonition'>
|
2204
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2205
|
+
<p>XYZ</p>
|
2206
|
+
</div>
|
2207
|
+
<hr/>
|
2208
|
+
</main>
|
2209
|
+
OUTPUT
|
2210
|
+
doc = <<~OUTPUT
|
2211
|
+
<html>
|
2212
|
+
<head/>
|
2213
|
+
<body>
|
2214
|
+
<div class='main-section'>
|
2215
|
+
<div id='FB' class='Note'>
|
2216
|
+
<p>
|
2217
|
+
<span class='note_label'>NOTE</span>
|
2218
|
+
  XYZ
|
2219
|
+
</p>
|
2220
|
+
</div>
|
2221
|
+
<div id='FC' class='Admonition'>
|
2222
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
2223
|
+
<p>XYZ</p>
|
2224
|
+
</div>
|
2225
|
+
<hr/>
|
2226
|
+
</div>
|
2227
|
+
</body>
|
2228
|
+
</html>
|
2229
|
+
OUTPUT
|
2230
|
+
expect(xmlpp(IsoDoc::HtmlConvert
|
2231
|
+
.new(wordstylesheet: "spec/assets/word.css",
|
2232
|
+
htmlstylesheet: "spec/assets/html.scss", filename: "test")
|
2233
|
+
.html_preface(Nokogiri::XML(input)).to_xml)
|
2234
|
+
.sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>"))
|
2235
|
+
.to be_equivalent_to xmlpp(html)
|
2236
|
+
expect(xmlpp(IsoDoc::WordConvert
|
2237
|
+
.new(wordstylesheet: "spec/assets/word.css",
|
2238
|
+
htmlstylesheet: "spec/assets/html.scss", filename: "test")
|
2239
|
+
.word_cleanup(Nokogiri::XML(input)).to_xml)
|
2240
|
+
.sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>"))
|
2241
|
+
.to be_equivalent_to xmlpp(doc)
|
2242
|
+
end
|
2243
|
+
|
2102
2244
|
it "deals with landscape and portrait pagebreaks (Word)" do
|
2103
2245
|
FileUtils.rm_f "test.doc"
|
2104
2246
|
IsoDoc::WordConvert.new(
|