isodoc 2.0.8.1 → 2.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +4 -2
  3. data/lib/isodoc/convert.rb +1 -1
  4. data/lib/isodoc/css.rb +11 -10
  5. data/lib/isodoc/function/blocks.rb +0 -39
  6. data/lib/isodoc/function/blocks_example_note.rb +36 -1
  7. data/lib/isodoc/function/inline.rb +4 -0
  8. data/lib/isodoc/function/references.rb +2 -15
  9. data/lib/isodoc/function/section.rb +5 -0
  10. data/lib/isodoc/function/to_word_html.rb +7 -11
  11. data/lib/isodoc/html_function/postprocess.rb +16 -2
  12. data/lib/isodoc/metadata.rb +2 -1
  13. data/lib/isodoc/presentation_function/bibdata.rb +30 -4
  14. data/lib/isodoc/presentation_function/block.rb +13 -1
  15. data/lib/isodoc/presentation_function/section.rb +36 -0
  16. data/lib/isodoc/presentation_xml_convert.rb +7 -2
  17. data/lib/isodoc/version.rb +1 -1
  18. data/lib/isodoc/word_function/postprocess.rb +4 -4
  19. data/lib/isodoc/word_function/postprocess_cover.rb +14 -0
  20. data/lib/isodoc/word_function/table.rb +12 -10
  21. data/lib/isodoc/xref/xref_anchor.rb +1 -1
  22. data/lib/isodoc/xref/xref_counter.rb +4 -1
  23. data/lib/isodoc/xref/xref_gen_seq.rb +3 -3
  24. data/lib/isodoc/xref/xref_sect_gen.rb +34 -36
  25. data/lib/isodoc/xref.rb +19 -8
  26. data/lib/isodoc-yaml/i18n-ar.yaml +9 -0
  27. data/lib/isodoc-yaml/i18n-de.yaml +13 -0
  28. data/lib/isodoc-yaml/i18n-en.yaml +5 -0
  29. data/lib/isodoc-yaml/i18n-es.yaml +11 -0
  30. data/lib/isodoc-yaml/i18n-fr.yaml +12 -1
  31. data/lib/isodoc-yaml/i18n-ru.yaml +13 -0
  32. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +5 -0
  33. data/lib/relaton/render/config.yml +4 -0
  34. data/lib/relaton/render/general.rb +35 -0
  35. data/spec/assets/i18n.yaml +6 -0
  36. data/spec/isodoc/blocks_spec.rb +249 -61
  37. data/spec/isodoc/i18n_spec.rb +266 -197
  38. data/spec/isodoc/inline_spec.rb +80 -106
  39. data/spec/isodoc/metadata_spec.rb +5 -3
  40. data/spec/isodoc/postproc_spec.rb +539 -397
  41. data/spec/isodoc/ref_spec.rb +52 -98
  42. data/spec/isodoc/section_spec.rb +4 -4
  43. data/spec/isodoc/xref_numbering_spec.rb +31 -0
  44. 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
- HAJSHJAS
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
- <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'>&#xA0;</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'>&#xA0;</p>
834
- </span>
835
- </p>
836
- <p class='MsoNormal'>&#xA0;</p>
837
- </div>
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'>&#xA0;</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'>&#xA0;</p>
834
+ </span>
835
+ </p>
836
+ <p class='MsoNormal'>&#xA0;</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
- <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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</p>
1137
- </span>
1138
- </p>
1139
- <p class='MsoNormal'>&#xA0;</p>
1140
- </div>
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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</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'>&#xA0;</p>
1137
+ </span>
1138
+ </p>
1139
+ <p class='MsoNormal'>&#xA0;</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>&#160; 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
+ &#xA0; 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
+ &#xA0; 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>&#160; 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
+ &#xA0; 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
+ &#xA0; 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(