metanorma-iec 1.3.6 → 1.3.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ module Metanorma
24
24
  "Times New Roman" => nil,
25
25
  "STIX Two Math" => nil,
26
26
  "Source Han Sans" => nil,
27
- "Courier" => nil,
27
+ "Source Han Sans Normal" => nil,
28
28
  "Courier New" => nil,
29
29
  }
30
30
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.3.6".freeze
3
+ VERSION = "1.3.10".freeze
4
4
  end
5
5
  end
6
6
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
29
29
 
30
- spec.add_dependency "metanorma-iso", "~> 1.8.6"
30
+ spec.add_dependency "metanorma-iso", "~> 1.9.0"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "byebug"
@@ -32,8 +32,8 @@ RSpec.describe Asciidoctor::Iec do
32
32
  #{ASCIIDOC_BLANK_HDR}
33
33
  [stem]
34
34
  ++++
35
- r = 1 %#{' '}
36
- r = 1 %#{' '}
35
+ r = 1 %
36
+ r = 1 %
37
37
  ++++
38
38
 
39
39
  [stem]
@@ -45,7 +45,7 @@ RSpec.describe Asciidoctor::Iec do
45
45
  #{@blank_hdr}
46
46
  <sections>
47
47
  <formula id="_">
48
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
48
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo><mi>r</mi><mo>=</mo><mn>1</mn><mo>%</mo></math></stem>
49
49
  </formula>
50
50
 
51
51
  <formula id="_">
@@ -4,15 +4,16 @@ require "fileutils"
4
4
  RSpec.describe IsoDoc::Iec do
5
5
  FileUtils.rm_f "test.html"
6
6
  it "processes isodoc as ISO: HTML output" do
7
- IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", false)
8
- <iso-standard xmlns="http://riboseinc.com/isoxml">
9
- <preface><foreword>
10
- <note>
11
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
12
- </note>
13
- </foreword></preface>
14
- </iso-standard>
15
- INPUT
7
+ IsoDoc::Iec::HtmlConvert.new({})
8
+ .convert("test", <<~"INPUT", false)
9
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
10
+ <preface><foreword>
11
+ <note>
12
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
13
+ </note>
14
+ </foreword></preface>
15
+ </iso-standard>
16
+ INPUT
16
17
  html = File.read("test.html", encoding: "utf-8")
17
18
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
18
19
  expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
@@ -20,16 +21,17 @@ RSpec.describe IsoDoc::Iec do
20
21
  end
21
22
 
22
23
  it "processes isodoc as ISO: Chinese HTML output" do
23
- FileUtils.rm_f "test.html"
24
- IsoDoc::Iec::HtmlConvert.new({script: "Hans"}).convert("test", <<~"INPUT", false)
25
- <iso-standard xmlns="http://riboseinc.com/isoxml">
26
- <preface><foreword>
27
- <note>
28
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
29
- </note>
30
- </foreword></preface>
31
- </iso-standard>
32
- INPUT
24
+ FileUtils.rm_f "test.html"
25
+ IsoDoc::Iec::HtmlConvert.new({ script: "Hans" })
26
+ .convert("test", <<~"INPUT", false)
27
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
28
+ <preface><foreword>
29
+ <note>
30
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
31
+ </note>
32
+ </foreword></preface>
33
+ </iso-standard>
34
+ INPUT
33
35
  html = File.read("test.html", encoding: "utf-8")
34
36
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
35
37
  expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
@@ -37,16 +39,19 @@ RSpec.describe IsoDoc::Iec do
37
39
  end
38
40
 
39
41
  it "processes isodoc as ISO: user nominated fonts" do
40
- FileUtils.rm_f "test.html"
41
- IsoDoc::Iec::HtmlConvert.new({bodyfont: "Zapf Chancery", headerfont: "Comic Sans", monospacefont: "Andale Mono"}).convert("test", <<~"INPUT", false)
42
- <iso-standard xmlns="http://riboseinc.com/isoxml">
43
- <preface><foreword>
44
- <note>
45
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
46
- </note>
47
- </foreword></preface>
48
- </iso-standard>
49
- INPUT
42
+ FileUtils.rm_f "test.html"
43
+ IsoDoc::Iec::HtmlConvert
44
+ .new({ bodyfont: "Zapf Chancery", headerfont: "Comic Sans",
45
+ monospacefont: "Andale Mono" })
46
+ .convert("test", <<~"INPUT", false)
47
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
48
+ <preface><foreword>
49
+ <note>
50
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
51
+ </note>
52
+ </foreword></preface>
53
+ </iso-standard>
54
+ INPUT
50
55
  html = File.read("test.html", encoding: "utf-8")
51
56
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
52
57
  expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
@@ -54,16 +59,17 @@ RSpec.describe IsoDoc::Iec do
54
59
  end
55
60
 
56
61
  it "processes isodoc as ISO: Word output" do
57
- FileUtils.rm_f "test.doc"
58
- IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", false)
59
- <iso-standard xmlns="http://riboseinc.com/isoxml">
60
- <preface><foreword>
61
- <note>
62
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
63
- </note>
64
- </foreword></preface>
65
- </iso-standard>
66
- INPUT
62
+ FileUtils.rm_f "test.doc"
63
+ IsoDoc::Iec::WordConvert.new({})
64
+ .convert("test", <<~"INPUT", false)
65
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
66
+ <preface><foreword>
67
+ <note>
68
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
69
+ </note>
70
+ </foreword></preface>
71
+ </iso-standard>
72
+ INPUT
67
73
  html = File.read("test.doc", encoding: "utf-8")
68
74
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
69
75
  expect(html).to match(%r[Quote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
@@ -71,147 +77,135 @@ RSpec.describe IsoDoc::Iec do
71
77
  end
72
78
 
73
79
  it "processes examples" do
74
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
75
- <iso-standard xmlns="http://riboseinc.com/isoxml">
76
- <preface><foreword>
77
- <example id="samplecode">
78
- <name>EXAMPLE</name>
79
- <p>Hello</p>
80
- </example>
81
- </foreword></preface>
82
- </iso-standard>
80
+ input = <<~INPUT
81
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
82
+ <preface><foreword>
83
+ <example id="samplecode">
84
+ <name>EXAMPLE</name>
85
+ <p>Hello</p>
86
+ </example>
87
+ </foreword></preface>
88
+ </iso-standard>
83
89
  INPUT
84
- #{HTML_HDR}
85
- <div>
86
- <h1 class="ForewordTitle">FOREWORD</h1>
87
- <div class="boilerplate_legal"/>
88
- <div id="samplecode" class="example">
89
- <p><span class="example_label">EXAMPLE</span>&#160; Hello</p>
90
- </div>
91
- </div>
92
- #{IEC_TITLE1}
93
- </div>
94
- </body>
95
- </html>
90
+ html = <<~OUTPUT
91
+ #{HTML_HDR}
92
+ <div>
93
+ <h1 class="ForewordTitle">FOREWORD</h1>
94
+ <div class="boilerplate_legal"/>
95
+ <div id="samplecode" class="example">
96
+ <p><span class="example_label">EXAMPLE</span>&#160; Hello</p>
97
+ </div>
98
+ </div>
99
+ #{IEC_TITLE1}
100
+ </div>
101
+ </body>
102
+ </html>
96
103
  OUTPUT
97
- end
98
-
99
-
100
- it "processes sequences of examples" do
101
- expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
102
- <iso-standard xmlns="http://riboseinc.com/isoxml">
103
- <preface><foreword>
104
- <example id="samplecode">
105
- <name>EXAMPLE 1</name>
106
- <p>Hello</p>
107
- </example>
108
- <example id="samplecode2">
109
- <name>EXAMPLE 2</name>
110
- <p>Hello</p>
111
- </example>
112
- </foreword></preface>
113
- </iso-standard>
114
- INPUT
115
- #{HTML_HDR}
116
- <div>
117
- <h1 class="ForewordTitle">FOREWORD</h1>
118
- <div class="boilerplate_legal"/>
119
- <div id="samplecode" class="example">
120
- <p><span class="example_label">EXAMPLE 1</span>&#160; Hello</p>
121
- </div>
122
- <div id="samplecode2" class="example">
123
- <p><span class="example_label">EXAMPLE 2</span>&#160; Hello</p>
124
- </div>
125
- </div>
126
- #{IEC_TITLE1}
127
- </div>
128
- </body>
129
- </html>
104
+ doc = <<~OUTPUT
105
+ <body lang="EN-US" link="blue" vlink="#954F72">
106
+ <div class="WordSection2">
107
+ <p>
108
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
109
+ </p>
110
+ #{IEC_TITLE}
111
+ <div>
112
+ <h1 class="ForewordTitle">FOREWORD</h1>
113
+ <div class="boilerplate_legal"/>
114
+ <div id="samplecode" class="example">
115
+ <p><span class="example_label">EXAMPLE</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
116
+ </div>
117
+ </div>
118
+ <p>&#160;</p>
119
+ </div>
120
+ <p>
121
+ <br clear="all" class="section"/>
122
+ </p>
123
+ <div class="WordSection3">
124
+ #{IEC_TITLE1}
125
+ </div>
126
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
127
+ <div class="colophon"/>
128
+ </body>
130
129
  OUTPUT
130
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
131
+ .convert("test", input, true)))
132
+ .to be_equivalent_to xmlpp(html)
133
+ expect(xmlpp(IsoDoc::Iec::WordConvert.new({})
134
+ .convert("test", input, true)
135
+ .sub(/^.*<body/m, "<body")
136
+ .sub(%r{</body>.*$}m, "</body>")))
137
+ .to be_equivalent_to xmlpp(doc)
131
138
  end
132
139
 
133
- it "processes examples (Word)" do
134
- expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
135
- <iso-standard xmlns="http://riboseinc.com/isoxml">
136
- <preface><foreword>
137
- <example id="samplecode">
138
- <name>EXAMPLE</name>
139
- <p>Hello</p>
140
- </example>
141
- </foreword></preface>
142
- </iso-standard>
140
+ it "processes sequences of examples" do
141
+ input = <<~INPUT
142
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
143
+ <preface><foreword>
144
+ <example id="samplecode">
145
+ <name>EXAMPLE 1</name>
146
+ <p>Hello</p>
147
+ </example>
148
+ <example id="samplecode2">
149
+ <name>EXAMPLE 2</name>
150
+ <p>Hello</p>
151
+ </example>
152
+ </foreword></preface>
153
+ </iso-standard>
143
154
  INPUT
144
- <body lang="EN-US" link="blue" vlink="#954F72">
145
- <div class="WordSection2">
146
- <p>
147
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
148
- </p>
149
- #{IEC_TITLE}
150
- <div>
151
- <h1 class="ForewordTitle">FOREWORD</h1>
152
- <div class="boilerplate_legal"/>
153
- <div id="samplecode" class="example">
154
- <p><span class="example_label">EXAMPLE</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
155
- </div>
156
- </div>
157
- <p>&#160;</p>
158
- </div>
159
- <p>
160
- <br clear="all" class="section"/>
161
- </p>
162
- <div class="WordSection3">
163
- #{IEC_TITLE1}
164
- </div>
165
- <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
166
- <div class="colophon"/>
167
- </body>
155
+ html = <<~OUTPUT
156
+ #{HTML_HDR}
157
+ <div>
158
+ <h1 class="ForewordTitle">FOREWORD</h1>
159
+ <div class="boilerplate_legal"/>
160
+ <div id="samplecode" class="example">
161
+ <p><span class="example_label">EXAMPLE 1</span>&#160; Hello</p>
162
+ </div>
163
+ <div id="samplecode2" class="example">
164
+ <p><span class="example_label">EXAMPLE 2</span>&#160; Hello</p>
165
+ </div>
166
+ </div>
167
+ #{IEC_TITLE1}
168
+ </div>
169
+ </body>
170
+ </html>
168
171
  OUTPUT
169
- end
170
-
171
172
 
172
- it "processes sequences of examples (Word)" do
173
- expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
174
- <iso-standard xmlns="http://riboseinc.com/isoxml">
175
- <preface><foreword>
176
- <example id="samplecode">
177
- <name>EXAMPLE 1</name>
178
- <p>Hello</p>
179
- </example>
180
- <example id="samplecode2">
181
- <name>EXAMPLE 2</name>
182
- <p>Hello</p>
183
- </example>
184
- </foreword></preface>
185
- </iso-standard>
186
- INPUT
187
- <body lang="EN-US" link="blue" vlink="#954F72">
188
- <div class="WordSection2">
189
- <p>
190
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
191
- </p>
192
- #{IEC_TITLE}
193
- <div>
194
- <h1 class="ForewordTitle">FOREWORD</h1>
195
- <div class="boilerplate_legal"/>
196
- <div id="samplecode" class="example">
197
- <p><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
198
- </div>
199
- <div id="samplecode2" class="example">
200
- <p><span class="example_label">EXAMPLE 2</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
201
- </div>
202
- </div>
203
- <p>&#160;</p>
204
- </div>
205
- <p>
206
- <br clear="all" class="section"/>
207
- </p>
208
- <div class="WordSection3">
209
- #{IEC_TITLE1}
210
- </div>
211
- <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
212
- <div class="colophon"/>
213
- </body>
173
+ doc = <<~OUTPUT
174
+ <body lang="EN-US" link="blue" vlink="#954F72">
175
+ <div class="WordSection2">
176
+ <p>
177
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
178
+ </p>
179
+ #{IEC_TITLE}
180
+ <div>
181
+ <h1 class="ForewordTitle">FOREWORD</h1>
182
+ <div class="boilerplate_legal"/>
183
+ <div id="samplecode" class="example">
184
+ <p><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
185
+ </div>
186
+ <div id="samplecode2" class="example">
187
+ <p><span class="example_label">EXAMPLE 2</span><span style="mso-tab-count:1">&#160; </span>Hello</p>
188
+ </div>
189
+ </div>
190
+ <p>&#160;</p>
191
+ </div>
192
+ <p>
193
+ <br clear="all" class="section"/>
194
+ </p>
195
+ <div class="WordSection3">
196
+ #{IEC_TITLE1}
197
+ </div>
198
+ <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
199
+ <div class="colophon"/>
200
+ </body>
214
201
  OUTPUT
202
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
203
+ .convert("test", input, true)))
204
+ .to be_equivalent_to xmlpp(html)
205
+ expect(xmlpp(IsoDoc::Iec::WordConvert.new({})
206
+ .convert("test", input, true)
207
+ .sub(/^.*<body/m, "<body")
208
+ .sub(%r{</body>.*$}m, "</body>")))
209
+ .to be_equivalent_to xmlpp(doc)
215
210
  end
216
-
217
211
  end
@@ -5,25 +5,29 @@ RSpec.describe IsoDoc do
5
5
  it "generates file based on string input" do
6
6
  FileUtils.rm_f "test.doc"
7
7
  FileUtils.rm_f "test.html"
8
- IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", filename: "test"}).convert("test", <<~"INPUT", false)
9
- <iso-standard xmlns="http://riboseinc.com/isoxml">
10
- <bibdata>
11
- <title>
12
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
13
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
14
- <title type="title-part" language="en" format="text/plain">Rice</title>
15
- </title>
16
- </bibdata>
17
- <preface><foreword>
18
- <note>
19
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
20
- </note>
21
- </foreword></preface>
22
- </iso-standard>
8
+ input = <<~INPUT
9
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
10
+ <bibdata>
11
+ <title>
12
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
13
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
14
+ <title type="title-part" language="en" format="text/plain">Rice</title>
15
+ </title>
16
+ </bibdata>
17
+ <preface><foreword>
18
+ <note>
19
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
20
+ </note>
21
+ </foreword></preface>
22
+ </iso-standard>
23
23
  INPUT
24
+ IsoDoc::Iec::HtmlConvert
25
+ .new({ wordstylesheet: "spec/assets/word.css",
26
+ htmlstylesheet: "spec/assets/html.css", filename: "test" })
27
+ .convert("test", input, false)
24
28
  expect(File.exist?("test.html")).to be true
25
29
  html = File.read("test.html", encoding: "UTF-8")
26
- expect(html).to match(%r{<title>Cereals and pulses\&#xA0;\&#x2014; Specifications and test methods\&#xA0;\&#x2014; Rice</title>})
30
+ expect(html).to match(%r{<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>})
27
31
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
28
32
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
29
33
  end
@@ -31,25 +35,29 @@ RSpec.describe IsoDoc do
31
35
  it "generates HTML output docs with null configuration" do
32
36
  FileUtils.rm_f "test.doc"
33
37
  FileUtils.rm_f "test.html"
34
- IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
35
- <iso-standard xmlns="http://riboseinc.com/isoxml">
36
- <bibdata>
37
- <title>
38
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
39
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
40
- <title type="title-part" language="en" format="text/plain">Rice</title>
41
- </title>
42
- </bibdata>
43
- <preface><foreword>
44
- <note>
45
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
46
- </note>
47
- </foreword></preface>
48
- </iso-standard>
38
+ input = <<~INPUT
39
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
40
+ <bibdata>
41
+ <title>
42
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
43
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
44
+ <title type="title-part" language="en" format="text/plain">Rice</title>
45
+ </title>
46
+ </bibdata>
47
+ <preface><foreword>
48
+ <note>
49
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
50
+ </note>
51
+ </foreword></preface>
52
+ </iso-standard>
49
53
  INPUT
54
+ IsoDoc::Iec::HtmlConvert
55
+ .new({ wordstylesheet: "spec/assets/word.css",
56
+ htmlstylesheet: "spec/assets/html.css" })
57
+ .convert("test", input, false)
50
58
  expect(File.exist?("test.html")).to be true
51
59
  html = File.read("test.html", encoding: "UTF-8")
52
- expect(html).to match(%r{<title>Cereals and pulses\&#xA0;\&#x2014; Specifications and test methods\&#xA0;\&#x2014; Rice</title>})
60
+ expect(html).to match(%r{<title>Cereals and pulses&#xA0;&#x2014; Specifications and test methods&#xA0;&#x2014; Rice</title>})
53
61
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
54
62
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
55
63
  end
@@ -57,15 +65,19 @@ RSpec.describe IsoDoc do
57
65
  it "generates Word output docs with null configuration" do
58
66
  FileUtils.rm_f "test.doc"
59
67
  FileUtils.rm_f "test.html"
60
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
61
- <iso-standard xmlns="http://riboseinc.com/isoxml">
62
- <preface><foreword>
63
- <note>
64
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
65
- </note>
66
- </foreword></preface>
67
- </iso-standard>
68
+ input = <<~INPUT
69
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
70
+ <preface><foreword>
71
+ <note>
72
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
73
+ </note>
74
+ </foreword></preface>
75
+ </iso-standard>
68
76
  INPUT
77
+ IsoDoc::Iec::WordConvert
78
+ .new({ wordstylesheet: "spec/assets/word.css",
79
+ htmlstylesheet: "spec/assets/html.css" })
80
+ .convert("test", input, false)
69
81
  expect(File.exist?("test.doc")).to be true
70
82
  word = File.read("test.doc", encoding: "UTF-8")
71
83
  expect(word).to match(/<style>/)
@@ -74,7 +86,9 @@ RSpec.describe IsoDoc do
74
86
  it "generates HTML output docs with null configuration from file" do
75
87
  FileUtils.rm_f "spec/assets/iso.doc"
76
88
  FileUtils.rm_f "spec/assets/iso.html"
77
- IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.css"}).convert("spec/assets/iso.xml", nil, false)
89
+ IsoDoc::Iec::HtmlConvert
90
+ .new({ wordstylesheet: "word.css", htmlstylesheet: "html.css" })
91
+ .convert("spec/assets/iso.xml", nil, false)
78
92
  expect(File.exist?("spec/assets/iso.html")).to be true
79
93
  html = File.read("spec/assets/iso.html", encoding: "UTF-8")
80
94
  expect(html).to match(/<style>/)
@@ -84,198 +98,213 @@ RSpec.describe IsoDoc do
84
98
 
85
99
  it "generates Word output docs with null configuration from file" do
86
100
  FileUtils.rm_f "spec/assets/iso.doc"
87
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.css"}).convert("spec/assets/iso.xml", nil, false)
101
+ IsoDoc::Iec::WordConvert
102
+ .new({ wordstylesheet: "word.css", htmlstylesheet: "html.css" })
103
+ .convert("spec/assets/iso.xml", nil, false)
88
104
  expect(File.exist?("spec/assets/iso.doc")).to be true
89
105
  word = File.read("spec/assets/iso.doc", encoding: "UTF-8")
90
106
  expect(word).to match(/<w:WordDocument>/)
91
107
  expect(word).to match(/<style>/)
92
108
  end
93
109
 
94
- it "generates Pdf output docs with null configuration from file" do
110
+ it "generates Pdf output docs with null configuration from file" do
95
111
  FileUtils.rm_f "spec/assets/iso.pdf"
96
- IsoDoc::Iec::PdfConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
112
+ IsoDoc::Iec::PdfConvert
113
+ .new({ wordstylesheet: "spec/assets/word.css",
114
+ htmlstylesheet: "spec/assets/html.css" })
115
+ .convert("spec/assets/iso.xml", nil, false)
97
116
  expect(File.exist?("spec/assets/iso.pdf")).to be true
98
117
  end
99
118
 
100
119
  it "populates Word template with terms reference labels" do
101
120
  FileUtils.rm_f "test.doc"
102
121
  FileUtils.rm_f "test.html"
103
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
104
- <iso-standard xmlns="http://riboseinc.com/isoxml">
105
- <sections>
106
- <terms id="_terms_and_definitions" obligation="normative"><title>1<tab/>Terms and Definitions</title>
107
-
108
- <term id="paddy1">
109
- <name>1.1</name>
110
- <preferred>paddy</preferred>
111
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
112
- <termsource status="modified">
113
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
114
- <modification>
115
- <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
116
- </modification>
117
- </termsource></term>
118
-
119
- </terms>
120
- </sections>
121
- </iso-standard>
122
-
122
+ input = <<~INPUT
123
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
124
+ <sections>
125
+ <terms id="_terms_and_definitions" obligation="normative"><title>1<tab/>Terms and Definitions</title>
126
+ <term id="paddy1">
127
+ <name>1.1</name>
128
+ <preferred>paddy</preferred>
129
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
130
+ <termsource status="modified">
131
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
132
+ <modification>
133
+ <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
134
+ </modification>
135
+ </termsource></term>
136
+ </terms>
137
+ </sections>
138
+ </iso-standard>
123
139
  INPUT
124
- word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
125
- sub(%r{<br.*$}m, "")
140
+ IsoDoc::Iec::WordConvert
141
+ .new({ wordstylesheet: "spec/assets/word.css",
142
+ htmlstylesheet: "spec/assets/html.css" })
143
+ .convert("test", input, false)
144
+ word = File.read("test.doc", encoding: "UTF-8")
145
+ .sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
146
+ .sub(%r{<br.*$}m, "")
126
147
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
127
- <div class="WordSection3">
128
- #{IEC_TITLE1.gsub(/\&#160;/, "&#xA0;")}
129
- <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">&#xA0; </span>Terms and Definitions</h1>
130
- <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
131
- <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
132
- <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
133
- </div>
148
+ <div class="WordSection3">
149
+ #{IEC_TITLE1.gsub(/&#160;/, '&#xA0;')}
150
+ <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">&#xA0; </span>Terms and Definitions</h1>
151
+ <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
152
+ <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
153
+ <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
154
+ </div>
134
155
  OUTPUT
135
156
  end
136
157
 
137
158
  it "processes IsoXML terms for HTML" do
138
159
  FileUtils.rm_f "test.html"
139
160
  FileUtils.rm_f "test.doc"
140
- IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
141
- <iso-standard xmlns="http://riboseinc.com/isoxml">
142
- <sections>
143
- <terms id="_terms_and_definitions" obligation="normative"><title>1<tab/>Terms and Definitions</title>
144
-
145
- <term id="paddy1">
146
- <name>1.1</name>
147
- <preferred>paddy</preferred>
148
- <domain>rice</domain>
149
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
150
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
151
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
152
- <ul>
153
- <li>A</li>
154
- </ul>
155
- </termexample>
156
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
157
- <ul>
158
- <li>A</li>
159
- </ul>
160
- </termexample>
161
-
162
- <termsource status="modified">
163
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
164
- <modification>
165
- <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
166
- </modification>
167
- </termsource></term>
168
-
169
- <term id="paddy">
170
- <name>1.2</name>
171
- <preferred>paddy</preferred><admitted>paddy rice</admitted>
172
- <admitted>rough rice</admitted>
173
- <deprecates>cargo rice</deprecates>
174
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
175
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
176
- <ul>
177
- <li>A</li>
178
- </ul>
179
- </termexample>
180
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
181
- <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
182
- </termnote>
183
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
184
- <ul><li>A</li></ul>
185
- <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
186
- </termnote>
187
- <termsource status="identical">
188
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
189
- </termsource></term>
190
- </terms>
191
- </sections>
192
- </iso-standard>
161
+ input = <<~INPUT
162
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
163
+ <sections>
164
+ <terms id="_terms_and_definitions" obligation="normative"><title>1<tab/>Terms and Definitions</title>
165
+ <term id="paddy1">
166
+ <name>1.1</name>
167
+ <preferred>paddy</preferred>
168
+ <domain>rice</domain>
169
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
170
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
171
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
172
+ <ul>
173
+ <li>A</li>
174
+ </ul>
175
+ </termexample>
176
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
177
+ <ul>
178
+ <li>A</li>
179
+ </ul>
180
+ </termexample>
181
+ <termsource status="modified">
182
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
183
+ <modification>
184
+ <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
185
+ </modification>
186
+ </termsource></term>
187
+ <term id="paddy">
188
+ <name>1.2</name>
189
+ <preferred>paddy</preferred><admitted>paddy rice</admitted>
190
+ <admitted>rough rice</admitted>
191
+ <deprecates>cargo rice</deprecates>
192
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
193
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
194
+ <ul>
195
+ <li>A</li>
196
+ </ul>
197
+ </termexample>
198
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
199
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
200
+ </termnote>
201
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
202
+ <ul><li>A</li></ul>
203
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
204
+ </termnote>
205
+ <termsource status="identical">
206
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
207
+ </termsource></term>
208
+ </terms>
209
+ </sections>
210
+ </iso-standard>
193
211
  INPUT
212
+ IsoDoc::Iec::HtmlConvert
213
+ .new({ wordstylesheet: "spec/assets/word.css",
214
+ htmlstylesheet: "spec/assets/html.css" })
215
+ .convert("test", input, false)
194
216
  expect(File.exist?("test.html")).to be true
195
217
  html = File.read("test.html", encoding: "UTF-8")
196
218
  expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1</h2>})
197
219
  expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
198
220
  end
199
221
 
200
- it "inserts default paragraph between two tables for Word" do
222
+ it "inserts default paragraph between two tables for Word" do
201
223
  FileUtils.rm_f "test.doc"
202
224
  FileUtils.rm_f "test.html"
203
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
204
- <iso-standard xmlns="http://riboseinc.com/isoxml">
205
- <annex id="P" inline-header="false" obligation="normative">
206
- <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851c">
207
- <p id="_158d4efa-b1c9-4aec-b325-756de8e4c968">'1M', '01M', and '0001M' all describe the calendar month January.</p>
208
- </example>
209
- <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851d">
210
- <p id="_158d4efa-b1c9-4aec-b325-756de8e4c969">'2M', '02M', and '0002M' all describe the calendar month February.</p>
211
- </example>
212
- </annex>
213
- </iso-standard>
225
+ input = <<~INPUT
226
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
227
+ <annex id="P" inline-header="false" obligation="normative">
228
+ <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851c">
229
+ <p id="_158d4efa-b1c9-4aec-b325-756de8e4c968">'1M', '01M', and '0001M' all describe the calendar month January.</p>
230
+ </example>
231
+ <example id="_63112cbc-cde0-435f-9553-e0b8c4f5851d">
232
+ <p id="_158d4efa-b1c9-4aec-b325-756de8e4c969">'2M', '02M', and '0002M' all describe the calendar month February.</p>
233
+ </example>
234
+ </annex>
235
+ </iso-standard>
214
236
  INPUT
215
- word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
216
- sub(%r{<br[^>]*>\s*<div class="colophon">.*$}m, "")
237
+ IsoDoc::Iec::WordConvert
238
+ .new({ wordstylesheet: "spec/assets/word.css",
239
+ htmlstylesheet: "spec/assets/html.css" })
240
+ .convert("test", input, false)
241
+ word = File.read("test.doc", encoding: "UTF-8")
242
+ .sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
243
+ .sub(%r{<br[^>]*>\s*<div class="colophon">.*$}m, "")
217
244
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
218
- <div class="WordSection3">
219
- #{IEC_TITLE1.gsub(/\&#160;/, "&#xA0;")}
220
- <p class="MsoNormal">
221
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
222
- </p>
223
- <div class="Section3"><a name="P" id="P"></a>
224
- <div class="example"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851c" id="_63112cbc-cde0-435f-9553-e0b8c4f5851c"></a>
225
- <p class="example"><span style="mso-tab-count:1">&#xA0; </span>'1M', '01M', and '0001M' all describe the calendar month January.</p>
226
- </div>
227
- <div class="example"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851d" id="_63112cbc-cde0-435f-9553-e0b8c4f5851d"></a>
228
- <p class="example"><span style="mso-tab-count:1">&#xA0; </span>'2M', '02M', and '0002M' all describe the calendar month February.</p>
245
+ <div class="WordSection3">
246
+ #{IEC_TITLE1.gsub(/&#160;/, '&#xA0;')}
247
+ <p class="MsoNormal">
248
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
249
+ </p>
250
+ <div class="Section3"><a name="P" id="P"></a>
251
+ <div class="example"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851c" id="_63112cbc-cde0-435f-9553-e0b8c4f5851c"></a>
252
+ <p class="example"><span style="mso-tab-count:1">&#xA0; </span>'1M', '01M', and '0001M' all describe the calendar month January.</p>
253
+ </div>
254
+ <div class="example"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851d" id="_63112cbc-cde0-435f-9553-e0b8c4f5851d"></a>
255
+ <p class="example"><span style="mso-tab-count:1">&#xA0; </span>'2M', '02M', and '0002M' all describe the calendar month February.</p>
256
+ </div>
229
257
  </div>
230
258
  </div>
231
- </div>
232
259
  OUTPUT
233
260
  end
234
261
 
235
- it "processes source code in tables (Word)" do
236
- FileUtils.rm_f "test.doc"
262
+ it "processes source code in tables (Word)" do
263
+ FileUtils.rm_f "test.doc"
237
264
  FileUtils.rm_f "test.html"
238
- IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
239
- <iso-standard xmlns="http://riboseinc.com/isoxml">
240
- <annex id="P" inline-header="false" obligation="normative">
241
- <sourcecode lang="ruby" id="A">puts "Hello, world."</sourcecode>
242
- <table id="samplecode">
243
- <tbody>
244
- <tr><td>
245
- <sourcecode lang="ruby" id="B">puts "Hello, world."</sourcecode>
246
- </td></tr>
247
- </tbody>
248
- </table>
249
- </annex>
250
- </iso-standard>
265
+ input = <<~INPUT
266
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
267
+ <annex id="P" inline-header="false" obligation="normative">
268
+ <sourcecode lang="ruby" id="A">puts "Hello, world."</sourcecode>
269
+ <table id="samplecode">
270
+ <tbody>
271
+ <tr><td>
272
+ <sourcecode lang="ruby" id="B">puts "Hello, world."</sourcecode>
273
+ </td></tr>
274
+ </tbody>
275
+ </table>
276
+ </annex>
277
+ </iso-standard>
251
278
  INPUT
252
- word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
253
- sub(%r{<br[^>]*>\s*<div class="colophon">.*$}m, "")
279
+ IsoDoc::Iec::WordConvert
280
+ .new({ wordstylesheet: "spec/assets/word.css",
281
+ htmlstylesheet: "spec/assets/html.css" })
282
+ .convert("test", input, false)
283
+ word = File.read("test.doc", encoding: "UTF-8")
284
+ .sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
285
+ .sub(%r{<br[^>]*>\s*<div class="colophon">.*$}m, "")
254
286
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
255
- <div class="WordSection3">
256
- #{IEC_TITLE1.gsub(/\&#160;/, "&#xA0;")}
257
- <p class="MsoNormal">
258
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
259
- </p>
260
- <div class="Section3"><a name="P" id="P"></a>
261
- <p class="Sourcecode"><a name="A" id="A"></a>puts "Hello, world."</p>
262
- <div align='center' class='table_container'>
263
- <table class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
264
- <a name='samplecode' id='samplecode'/>
265
- <tbody>
266
- <tr>
267
- <td style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" class="TABLE-cell">
268
- <p class="CODE-TableCell"><a name="B" id="B"></a>puts "Hello, world."</p>
269
- </td>
270
- </tr>
271
- </tbody>
272
- </table>
287
+ <div class="WordSection3">
288
+ #{IEC_TITLE1.gsub(/&#160;/, '&#xA0;')}
289
+ <p class="MsoNormal">
290
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
291
+ </p>
292
+ <div class="Section3"><a name="P" id="P"></a>
293
+ <p class="Sourcecode"><a name="A" id="A"></a>puts "Hello, world."</p>
294
+ <div align='center' class='table_container'>
295
+ <table class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
296
+ <a name='samplecode' id='samplecode'/>
297
+ <tbody>
298
+ <tr>
299
+ <td style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" class="TABLE-cell">
300
+ <p class="CODE-TableCell"><a name="B" id="B"></a>puts "Hello, world."</p>
301
+ </td>
302
+ </tr>
303
+ </tbody>
304
+ </table>
305
+ </div>
273
306
  </div>
274
307
  </div>
275
- </div>
276
308
  OUTPUT
277
- end
278
-
279
-
280
-
309
+ end
281
310
  end