isodoc 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29fb94d37c013e802491e2c1266e8b39d607ea3050f272f1a7bcd398e57c0283
4
- data.tar.gz: 85ea530071d54477f462d34a5b18dbf9ba500b71a4d5ea858b62530757a6b795
3
+ metadata.gz: bf37a37eb402d844a36b33e3911c67d3ebcbef7bf7f864dfc0e9f3a8aca7603c
4
+ data.tar.gz: cc3645b92e85d43e2c6e49cfce67cc13d0f656cf1c16d67247cb7053eceba394
5
5
  SHA512:
6
- metadata.gz: 9539cdc3d0fac50a04aa3cdf93581016306b660f1d0681a8a1e06255ed839ac9362c887b9a6f0ef7480711122c5275e0936fab640efff76c84aaa5ad84831f84
7
- data.tar.gz: b05012f1f7189becfa14871de424ae5713a8791a9c0b520cdcca591d3f733d996c776d2f37d2c1ff23fdff6b2c146b6e09d2f9c5b97dcbeec43edafd9785dfcb
6
+ metadata.gz: 83bfcc73e86c73c9373bf9b42170ebc58c4ae50e4a0789cacddefa05c5b80fe1c59559e3abde2071e79aa3fd839d7844b3c0145ca89ed09b9d6d7e09b1e03de9
7
+ data.tar.gz: 11fbb6a5a6a19eadae64d22dd032185eaed46a1dd007f188e26cc73153e75ceb16ec3c64c8613c8dc05e0263fafab98655287e23993c34ebcf815096dca50bda
@@ -97,3 +97,58 @@ locality: {
97
97
  note: Note,
98
98
  formula: Formula
99
99
  }
100
+ inflection:
101
+ Clause:
102
+ sg: Clause
103
+ pl: Clauses
104
+ Annex:
105
+ sg: Annex
106
+ pl: Annexes
107
+ Appendix:
108
+ sg: Appendix
109
+ pl: Appendixes
110
+ Note:
111
+ sg: Note
112
+ pl: Notes
113
+ "Note % to entry":
114
+ sg: Note % to entry
115
+ pl: Notes % to entry
116
+ List:
117
+ sg: List
118
+ pl: Lists
119
+ Figure:
120
+ sg: Figure
121
+ pl: Figures
122
+ Formula:
123
+ sg: Formula
124
+ pl: Formulas
125
+ Table:
126
+ sg: Table
127
+ pl: Tables
128
+ Requirement:
129
+ sg: Requirement
130
+ pl: Requirements
131
+ Recommendation:
132
+ sg: Recommendation
133
+ pl: Recommendations
134
+ Permission:
135
+ sg: Permission
136
+ pl: Permissions
137
+ Example:
138
+ sg: Example
139
+ pl: Examples
140
+ Part:
141
+ sg: Part
142
+ pl: Parts
143
+ Section:
144
+ sg: Section
145
+ pl: Sections
146
+ Paragraph:
147
+ sg: Paragraph
148
+ pl: Paragraphs
149
+ Chapter:
150
+ sg: Chapter
151
+ pl: Chapters
152
+ Page:
153
+ sg: Page
154
+ pl: Pages
@@ -90,3 +90,59 @@ locality: {
90
90
  note: Note,
91
91
  formula: Formule
92
92
  }
93
+ inflection:
94
+ Clause:
95
+ sg: Article
96
+ pl: Articles
97
+ Annex:
98
+ sg: Annexe
99
+ pl: Annexes
100
+ Appendix:
101
+ sg: Appendice
102
+ pl: Appendices
103
+ Note:
104
+ sg: Note
105
+ pl: Notes
106
+ "Note % à l’article":
107
+ sg: Note % à l’article
108
+ pl: Notes % à l’article
109
+ List:
110
+ sg: Liste
111
+ pl: Listes
112
+ Figure:
113
+ sg: Figure
114
+ pl: Figures
115
+ Formula:
116
+ sg: Formule
117
+ pl: Formules
118
+ Table:
119
+ sg: Tableau
120
+ pl: Tableaux
121
+ Requirement:
122
+ sg: Exigence
123
+ pl: Exigences
124
+ Recommendation:
125
+ sg: Recommandation
126
+ pl: Recommandations
127
+ Permission:
128
+ sg: Autorisation
129
+ pl: Autorisations
130
+ Example:
131
+ sg: Exemple
132
+ pl: Exemples
133
+ Part:
134
+ sg: Partie
135
+ pl: Parties
136
+ Section:
137
+ sg: Section
138
+ pl: Sections
139
+ Paragraph:
140
+ sg: Alinéa
141
+ pl: Alinéas
142
+ Chapter:
143
+ sg: Chapitre
144
+ pl: Chapitres
145
+ Page:
146
+ sg: Page
147
+ pl: Pages
148
+
@@ -157,7 +157,7 @@ module IsoDoc
157
157
  FileUtils.rm_rf dir
158
158
  end
159
159
 
160
- def middle_clause
160
+ def middle_clause(docxml = nil)
161
161
  "//clause[parent::sections][not(@type = 'scope')]"\
162
162
  '[not(descendant::terms)]'
163
163
  end
@@ -56,7 +56,7 @@ module IsoDoc::Function
56
56
  end
57
57
 
58
58
  def clause(isoxml, out)
59
- isoxml.xpath(ns(middle_clause)).each do |c|
59
+ isoxml.xpath(ns(middle_clause(isoxml))).each do |c|
60
60
  out.div **attr_code(clause_attrs(c)) do |s|
61
61
  clause_name(nil, c&.at(ns("./title")), s, nil)
62
62
  c.elements.reject { |c1| c1.name == "title" }.each do |c1|
@@ -0,0 +1,82 @@
1
+ module IsoDoc
2
+ module HtmlFunction
3
+ # Class for recursively converting mathvariant text into plain text symbols
4
+ class MathvariantToPlain
5
+ MATHML = { "m" => "http://www.w3.org/1998/Math/MathML" }.freeze
6
+ MATHVARIANT_SPECIAL_CASE_MAPPINGS_1 = %w[bold italic sans-serif]
7
+ .permutation
8
+ .each_with_object(:sansbolditalic)
9
+ .map { |n, y| [n, y] }
10
+ .to_h
11
+ .freeze
12
+ MATHVARIANT_SPECIAL_CASE_MAPPINGS_2 = {
13
+ %w[bold fraktur] => :frakturbold,
14
+ %w[bold script] => :scriptbold,
15
+ %w[sans-serif bold] => :sansbold,
16
+ %w[sans-serif italic] => :sansitalic,
17
+ %w[sans-serif bold-italic] => :sansbolditalic,
18
+ %w[bold-sans-serif italic] => :sansbolditalic,
19
+ %w[sans-serif-italic bold] => :sansbolditalic,
20
+ }.freeze
21
+ MATHVARIANT_TO_PLANE_MAPPINGS = {
22
+ %w[double-struck] => :doublestruck,
23
+ %w[bold-fraktur] => :frakturbold,
24
+ %w[script] => :script,
25
+ %w[bold-script] => :scriptbold,
26
+ %w[fraktur] => :fraktur,
27
+ %w[sans-serif] => :sans,
28
+ %w[bold-sans-serif] => :sansbold,
29
+ %w[sans-serif-italic] => :sansitalic,
30
+ %w[sans-serif-bold-italic] => :sansbolditalic,
31
+ %w[monospace] => :monospace,
32
+ }.freeze
33
+
34
+ attr_reader :docxml
35
+
36
+ # @param [Nokogiri::Document] docxml
37
+ def initialize(docxml)
38
+ @docxml = docxml
39
+ end
40
+
41
+ def convert
42
+ docxml.xpath("//m:math", MATHML).each do |elem|
43
+ next if nothing_to_style(elem)
44
+ mathml1(elem)
45
+ end
46
+ docxml
47
+ end
48
+
49
+ private
50
+
51
+ def nothing_to_style(elem)
52
+ !elem.at("./*[@mathvariant][not(@mathvariant = 'normal')][not(@mathvariant = 'italic')]")
53
+ end
54
+
55
+ def mathml1(base_elem)
56
+ MATHVARIANT_SPECIAL_CASE_MAPPINGS_1
57
+ .merge(MATHVARIANT_SPECIAL_CASE_MAPPINGS_2)
58
+ .merge(MATHVARIANT_TO_PLANE_MAPPINGS)
59
+ .each_pair do |mathvariant_list, plain_font|
60
+ base_elem.xpath(mathvariant_xpath(mathvariant_list)).each do |elem|
61
+ toPlane(elem, plain_font)
62
+ end
63
+ end
64
+ end
65
+
66
+ def mathvariant_xpath(list)
67
+ list
68
+ .map { |variant| "//*[@mathvariant = '#{variant}']" }
69
+ .join
70
+ end
71
+
72
+ def toPlane(elem, font)
73
+ elem.traverse do |n|
74
+ next unless n.text?
75
+
76
+ n.replace(Plane1Converter.conv(HTMLEntities.new.decode(n.text), font))
77
+ end
78
+ elem
79
+ end
80
+ end
81
+ end
82
+ end
@@ -1,35 +1,47 @@
1
+ require "isodoc/html_function/mathvariant_to_plain"
2
+
1
3
  module IsoDoc::HtmlFunction
2
4
  module Html
3
- def postprocess(result, filename, dir)
5
+ def postprocess(result, filename, _dir)
4
6
  result = from_xhtml(cleanup(to_xhtml(textcleanup(result))))
5
7
  toHTML(result, filename)
6
8
  @files_to_delete.each { |f| FileUtils.rm_rf f }
7
9
  end
8
10
 
9
11
  def script_cdata(result)
10
- result.gsub(%r{<script([^>]*)>\s*<!\[CDATA\[}m, "<script\\1>").
11
- gsub(%r{\]\]>\s*</script>}, "</script>").
12
- gsub(%r{<!\[CDATA\[\s*<script([^>]*)>}m, "<script\\1>").
13
- gsub(%r{</script>\s*\]\]>}, "</script>")
12
+ result.gsub(%r{<script([^>]*)>\s*<!\[CDATA\[}m, "<script\\1>")
13
+ .gsub(%r{\]\]>\s*</script>}, "</script>")
14
+ .gsub(%r{<!\[CDATA\[\s*<script([^>]*)>}m, "<script\\1>")
15
+ .gsub(%r{</script>\s*\]\]>}, "</script>")
14
16
  end
15
17
 
16
18
  def toHTML(result, filename)
17
- result = (from_xhtml(html_cleanup(to_xhtml(result))))
18
- #result = populate_template(result, :html)
19
+ result = from_xhtml(html_cleanup(to_xhtml(result)))
20
+ # result = populate_template(result, :html)
19
21
  result = from_xhtml(move_images(to_xhtml(result)))
20
22
  result = html5(script_cdata(inject_script(result)))
21
23
  File.open(filename, "w:UTF-8") { |f| f.write(result) }
22
24
  end
23
25
 
24
26
  def html5(doc)
25
- doc.sub(%r{<!DOCTYPE html [^>]+>}, "<!DOCTYPE html>").
26
- sub(%r{<\?xml[^>]+>}, "")
27
+ doc.sub(%r{<!DOCTYPE html [^>]+>}, "<!DOCTYPE html>")
28
+ .sub(%r{<\?xml[^>]+>}, "")
27
29
  end
28
30
 
29
31
  def html_cleanup(x)
30
- footnote_format(footnote_backlinks(html_toc(
31
- term_header((html_footnote_filter(html_preface(htmlstyle(x))))))
32
- ))
32
+ mathml(
33
+ footnote_format(
34
+ footnote_backlinks(
35
+ html_toc(
36
+ term_header(html_footnote_filter(html_preface(htmlstyle(x))))
37
+ )
38
+ )
39
+ )
40
+ )
41
+ end
42
+
43
+ def mathml(docxml)
44
+ IsoDoc::HtmlFunction::MathvariantToPlain.new(docxml).convert
33
45
  end
34
46
 
35
47
  def htmlstylesheet
@@ -76,14 +88,14 @@ module IsoDoc::HtmlFunction
76
88
  def html_cover(docxml)
77
89
  doc = to_xhtml_fragment(File.read(@htmlcoverpage, encoding: "UTF-8"))
78
90
  d = docxml.at('//div[@class="title-section"]')
79
- #d.children.first.add_previous_sibling doc.to_xml(encoding: "US-ASCII")
91
+ # d.children.first.add_previous_sibling doc.to_xml(encoding: "US-ASCII")
80
92
  d.children.first.add_previous_sibling populate_template(doc.to_xml(encoding: "US-ASCII"), :html)
81
93
  end
82
94
 
83
95
  def html_intro(docxml)
84
96
  doc = to_xhtml_fragment(File.read(@htmlintropage, encoding: "UTF-8"))
85
97
  d = docxml.at('//div[@class="prefatory-section"]')
86
- #d.children.first.add_previous_sibling doc.to_xml(encoding: "US-ASCII")
98
+ # d.children.first.add_previous_sibling doc.to_xml(encoding: "US-ASCII")
87
99
  d.children.first.add_previous_sibling populate_template(doc.to_xml(encoding: "US-ASCII"), :html)
88
100
  end
89
101
 
@@ -93,19 +105,19 @@ module IsoDoc::HtmlFunction
93
105
  end
94
106
 
95
107
  def toclevel_classes
96
- (1..@htmlToClevels).inject([]) { |m, i| m << "h#{i}" }
108
+ (1..@htmlToClevels).reduce([]) { |m, i| m << "h#{i}" }
97
109
  end
98
110
 
99
111
  def toclevel
100
112
  ret = toclevel_classes.map { |l| "#{l}:not(:empty):not(.TermNum):not(.noTOC)" }
101
113
  <<~HEAD.freeze
102
- function toclevel() { return "#{ret.join(',')}";}
114
+ function toclevel() { return "#{ret.join(',')}";}
103
115
  HEAD
104
116
  end
105
117
 
106
118
  # needs to be same output as toclevel
107
119
  def html_toc(docxml)
108
- idx = docxml.at("//div[@id = 'toc']") or return docxml
120
+ (idx = docxml.at("//div[@id = 'toc']")) or (return docxml)
109
121
  toc = "<ul>"
110
122
  path = toclevel_classes.map do |l|
111
123
  "//main//#{l}[not(@class = 'TermNum')][not(@class = 'noTOC')][text()]"
@@ -17,9 +17,10 @@ module IsoDoc
17
17
  def extract_person_affiliations(authors)
18
18
  authors.reduce([]) do |m, a|
19
19
  name = a&.at(ns('./affiliation/organization/name'))&.text
20
- location = a&.at(ns('./affiliation/organization/address/'\
21
- 'formattedAddress'))&.text
22
- m << (!name.nil? && !location.nil? ? "#{name}, #{location}" :
20
+ subdivs = a&.xpath(ns('./affiliation/organization/subdivision'))&.map(&:text)&.join(", ")
21
+ name and subdivs and !subdivs.empty? and name = l10n("#{name}, #{subdivs}", @lang, @script)
22
+ location = a&.at(ns('./affiliation/organization/address/formattedAddress'))&.text
23
+ m << (!name.nil? && !location.nil? ? l10n("#{name}, #{location}", @lang, @script) :
23
24
  (name || location || ''))
24
25
  m
25
26
  end
@@ -43,6 +43,9 @@ module IsoDoc
43
43
  prefix_name(f, "", "#{lbl}#{clausedelim}", "name")
44
44
  end
45
45
 
46
+ def references(docxml)
47
+ end
48
+
46
49
  def index(docxml)
47
50
  docxml.xpath(ns("//index | //index-xref")).each do |f|
48
51
  f.remove
@@ -30,6 +30,7 @@ module IsoDoc
30
30
  clause docxml
31
31
  annex docxml
32
32
  term docxml
33
+ references docxml
33
34
  index docxml
34
35
  end
35
36
 
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.3.1".freeze
2
+ VERSION = "1.4.0".freeze
3
3
  end
@@ -68,7 +68,7 @@ module IsoDoc::XrefGen
68
68
  end
69
69
 
70
70
  def clause_names(docxml, sect_num)
71
- docxml.xpath(ns(@klass.middle_clause)).each_with_index do |c, i|
71
+ docxml.xpath(ns(@klass.middle_clause(docxml))).each_with_index do |c, i|
72
72
  section_names(c, (i + sect_num), 1)
73
73
  end
74
74
  end
@@ -534,7 +534,7 @@ INPUT
534
534
  <div>
535
535
  <h1 class='ForewordTitle'>Foreword</h1>
536
536
  <p id='A'>
537
- ABC
537
+ ABC
538
538
  <div id='B' class='Note'>
539
539
  <p>
540
540
  <span class='note_label'>NOTE 1</span>
@@ -60,6 +60,8 @@ RSpec.describe IsoDoc do
60
60
  </name>
61
61
  <affiliation>
62
62
  <organization><name>Slate Inc.</name>
63
+ <subdivision>Hermeneutics Unit</subdivision>
64
+ <subdivision>Exegesis Subunit</subdivision>
63
65
  <address>
64
66
  <formattedAddress>Bedrock</formattedAddress>
65
67
  </address>
@@ -106,7 +108,7 @@ INPUT
106
108
  :activateddate=>"2013",
107
109
  :agency=>"ISO",
108
110
  :authors=>["Barney Rubble", "Fred Flintstone"],
109
- :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]},
111
+ :authors_affiliations=>{"Slate Inc., Hermeneutics Unit, Exegesis Subunit, Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]},
110
112
  :circulateddate=>"2015",
111
113
  :confirmeddate=>"2017",
112
114
  :copieddate=>"2016",
@@ -617,6 +617,169 @@ TOCLEVEL
617
617
 
618
618
  end
619
619
 
620
+ describe "mathvariant to plain" do
621
+ context "when `mathvariant` attr equal to `script`" do
622
+ it "converts mathvariant text chars into associated plain chars" do
623
+ FileUtils.rm_f "test.html"
624
+ FileUtils.rm_rf "test_htmlimages"
625
+ input = <<~INPUT
626
+ <?xml version="1.0" encoding="UTF-8"?>
627
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="1.5.14">
628
+ <sections>
629
+ <clause id="_clause" inline-header="false" obligation="normative">
630
+ <title>Clause</title>
631
+ <p id="_20514f5a-9f86-454e-b6ce-927f65ba6441">
632
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
633
+ <mi>x</mi>
634
+ <mo>=</mo>
635
+ <mstyle mathvariant="script">
636
+ <mi>l</mi>
637
+ </mstyle>
638
+ <mo>+</mo>
639
+ <mn>1</mn>
640
+ </math></stem>
641
+ </p>
642
+ </clause>
643
+ </sections>
644
+ </iso-standard>
645
+ INPUT
646
+ output = <<~OUTPUT
647
+ <main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
648
+ <p class="zzSTDTitle1"></p>
649
+ <div id="_clause">
650
+ <h1>Clause</h1>
651
+ <p id="_20514f5a-9f86-454e-b6ce-927f65ba6441">
652
+ <span class="stem"><math xmlns="http://www.w3.org/1998/Math/MathML">
653
+ <mi>x</mi>
654
+ <mo>=</mo>
655
+ <mstyle mathvariant="script">
656
+ <mi>&#x1D4C1;</mi>
657
+ </mstyle>
658
+ <mo>+</mo>
659
+ <mn>1</mn>
660
+ </math></span>
661
+ </p>
662
+ </div>
663
+ </main>
664
+ OUTPUT
665
+ IsoDoc::HtmlConvert.new({}).convert("test", input, false)
666
+ html = File.read("test.html")
667
+ .sub(/^.*<main class="main-section">/m, '<main class="main-section">')
668
+ .sub(%r{</main>.*$}m, "</main>")
669
+ expect(html).to(be_equivalent_to(output))
670
+ end
671
+ end
672
+
673
+ context "when complex `mathvariant` combinations" do
674
+ it "converts mathvariant text chars into associated plain chars" do
675
+ FileUtils.rm_f "test.html"
676
+ FileUtils.rm_rf "test_htmlimages"
677
+ input = <<~INPUT
678
+ <?xml version="1.0" encoding="UTF-8"?>
679
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="1.5.14">
680
+ <sections>
681
+ <clause id="_clause" inline-header="false" obligation="normative">
682
+ <title>Clause</title>
683
+ <p id="_20514f5a-9f86-454e-b6ce-927f65ba6441">
684
+ <stem type="MathML">
685
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
686
+ <mstyle mathvariant="sans-serif">
687
+ <mfrac>
688
+ <mrow>
689
+ <mrow>
690
+ <mi>n</mi>
691
+ <mfenced open="(" close=")">
692
+ <mrow>
693
+ <mstyle mathvariant="bold">
694
+ <mrow>
695
+ <mi>n</mi>
696
+ <mo>+</mo>
697
+ <mn>1</mn>
698
+ <mo>+</mo>
699
+ <mstyle mathvariant="italic">
700
+ <mi>x</mi>
701
+ </mstyle>
702
+ </mrow>
703
+ </mstyle>
704
+ </mrow>
705
+ </mfenced>
706
+ </mrow>
707
+ </mrow>
708
+ <mrow>
709
+ <mstyle mathvariant="bold">
710
+ <mrow>
711
+ <mi>y</mi>
712
+ <mo>+</mo>
713
+ <mstyle mathvariant="fraktur">
714
+ <mi>z</mi>
715
+ </mstyle>
716
+ </mrow>
717
+ </mstyle>
718
+ </mrow>
719
+ </mfrac>
720
+ </mstyle>
721
+ </math>
722
+ </stem>
723
+ </p>
724
+ </clause>
725
+ </sections>
726
+ </iso-standard>
727
+ INPUT
728
+ output = <<~OUTPUT
729
+ <main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
730
+ <p class="zzSTDTitle1"></p>
731
+ <div id="_clause">
732
+ <h1>Clause</h1>
733
+ <p id="_20514f5a-9f86-454e-b6ce-927f65ba6441">
734
+ <span class="stem"><math xmlns="http://www.w3.org/1998/Math/MathML">
735
+ <mstyle mathvariant="sans-serif">
736
+ <mfrac>
737
+ <mrow>
738
+ <mrow>
739
+ <mi>&#x1D5C7;</mi>
740
+ <mfenced open="(" close=")">
741
+ <mrow>
742
+ <mstyle mathvariant="bold">
743
+ <mrow>
744
+ <mi>&#x1D5FB;</mi>
745
+ <mo>+</mo>
746
+ <mn>&#x1D7ED;</mn>
747
+ <mo>+</mo>
748
+ <mstyle mathvariant="italic">
749
+ <mi>&#x1D66D;</mi>
750
+ </mstyle>
751
+ </mrow>
752
+ </mstyle>
753
+ </mrow>
754
+ </mfenced>
755
+ </mrow>
756
+ </mrow>
757
+ <mrow>
758
+ <mstyle mathvariant="bold">
759
+ <mrow>
760
+ <mi>&#x1D606;</mi>
761
+ <mo>+</mo>
762
+ <mstyle mathvariant="fraktur">
763
+ <mi>&#x1D59F;</mi>
764
+ </mstyle>
765
+ </mrow>
766
+ </mstyle>
767
+ </mrow>
768
+ </mfrac>
769
+ </mstyle>
770
+ </math></span>
771
+ </p>
772
+ </div>
773
+ </main>
774
+ OUTPUT
775
+ IsoDoc::HtmlConvert.new({}).convert("test", input, false)
776
+ html = File.read("test.html")
777
+ .sub(/^.*<main class="main-section">/m, '<main class="main-section">')
778
+ .sub(%r{</main>.*$}m, "</main>")
779
+ expect(html).to(be_equivalent_to(output))
780
+ end
781
+ end
782
+ end
620
783
 
621
784
  it "moves images in HTML with no file suffix" do
622
785
  FileUtils.rm_f "test.html"
@@ -1047,7 +1210,7 @@ TOCLEVEL
1047
1210
  OUTPUT
1048
1211
  end
1049
1212
 
1050
- it "deals with image captions (Word)" do
1213
+ it "deals with image captions (Word)" do
1051
1214
  FileUtils.rm_f "test.doc"
1052
1215
  FileUtils.rm_f "test.html"
1053
1216
  IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("test", <<~"INPUT", false)
@@ -1366,7 +1529,7 @@ expect(xmlpp(html.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).
1366
1529
  <div class='Section3' id=''>
1367
1530
  <h1 class='IntroTitle'>Preface 1</h1>
1368
1531
  <p align='center' style='text-align:center;' class='MsoNormal'>
1369
- This is a
1532
+ This is a
1370
1533
  <p class='MsoNormal'>
1371
1534
  <br clear='all' class='section'/>
1372
1535
  </p>
@@ -1412,7 +1575,7 @@ expect(xmlpp(html.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).
1412
1575
  <p class='Note'>
1413
1576
  <span class='note_label'/>
1414
1577
  <span style='mso-tab-count:1'>&#xA0; </span>
1415
- For further information on the Foreword, see
1578
+ For further information on the Foreword, see
1416
1579
  <b>ISO/IEC Directives, Part 2, 2016, Clause 12.</b>
1417
1580
  </p>
1418
1581
  <p class='Note'>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2020-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -374,6 +374,7 @@ files:
374
374
  - lib/isodoc/html_function/comments.rb
375
375
  - lib/isodoc/html_function/footnotes.rb
376
376
  - lib/isodoc/html_function/html.rb
377
+ - lib/isodoc/html_function/mathvariant_to_plain.rb
377
378
  - lib/isodoc/html_function/postprocess.rb
378
379
  - lib/isodoc/i18n.rb
379
380
  - lib/isodoc/metadata.rb