isodoc 2.1.1 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +4 -1
- data/lib/isodoc/base_style/blocks.scss +7 -0
- data/lib/isodoc/class_utils.rb +16 -0
- data/lib/isodoc/function/inline.rb +2 -0
- data/lib/isodoc/function/lists.rb +24 -9
- data/lib/isodoc/function/to_word_html.rb +1 -0
- data/lib/isodoc/function/utils.rb +21 -7
- data/lib/isodoc/gem_tasks.rb +19 -10
- data/lib/isodoc/i18n.rb +19 -0
- data/lib/isodoc/metadata.rb +2 -2
- data/lib/isodoc/presentation_function/block.rb +7 -3
- data/lib/isodoc/presentation_function/image.rb +1 -1
- data/lib/isodoc/presentation_function/inline.rb +11 -12
- data/lib/isodoc/presentation_function/section.rb +1 -1
- data/lib/isodoc/presentation_function/xrefs.rb +23 -9
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +6 -3
- data/lib/isodoc/word_function/inline.rb +7 -2
- data/lib/isodoc/xref/xref_gen.rb +6 -6
- data/lib/isodoc/xref.rb +1 -1
- data/lib/isodoc-yaml/i18n-ar.yaml +1 -0
- data/lib/isodoc-yaml/i18n-de.yaml +1 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- metadata +3 -50
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.hound.yml +0 -5
- data/.oss-guides.rubocop.yml +0 -1077
- data/.rubocop.yml +0 -10
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.scss +0 -20
- data/spec/assets/html_override.css +0 -1
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -41
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/odf.emf +0 -0
- data/spec/assets/odf.svg +0 -1
- data/spec/assets/odf1.svg +0 -4
- data/spec/assets/outputtest/a.xml +0 -66
- data/spec/assets/outputtest/iso.international-standard.xsl +0 -3011
- data/spec/assets/rice_image1 +0 -0
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/scripts_override.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/word_override.css +0 -1
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/isodoc/blocks_spec.rb +0 -2934
- data/spec/isodoc/cleanup_spec.rb +0 -1056
- data/spec/isodoc/footnotes_spec.rb +0 -264
- data/spec/isodoc/form_spec.rb +0 -160
- data/spec/isodoc/i18n_spec.rb +0 -1201
- data/spec/isodoc/inline_spec.rb +0 -2301
- data/spec/isodoc/lists_spec.rb +0 -469
- data/spec/isodoc/metadata_spec.rb +0 -401
- data/spec/isodoc/postproc_spec.rb +0 -2938
- data/spec/isodoc/presentation_xml_spec.rb +0 -1476
- data/spec/isodoc/ref_spec.rb +0 -955
- data/spec/isodoc/section_spec.rb +0 -2123
- data/spec/isodoc/table_spec.rb +0 -588
- data/spec/isodoc/terms_spec.rb +0 -712
- data/spec/isodoc/utils_spec.rb +0 -57
- data/spec/isodoc/xref_numbering_spec.rb +0 -378
- data/spec/isodoc/xref_spec.rb +0 -1837
- data/spec/isodoc/xslfo_convert_spec.rb +0 -103
- data/spec/spec_helper.rb +0 -88
@@ -1,264 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "fileutils"
|
3
|
-
|
4
|
-
RSpec.describe IsoDoc do
|
5
|
-
it "processes IsoXML footnotes" do
|
6
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
7
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
8
|
-
<preface>
|
9
|
-
<foreword>
|
10
|
-
<p>A.<fn reference="2">
|
11
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
|
12
|
-
</fn></p>
|
13
|
-
<p>B.<fn reference="2">
|
14
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
|
15
|
-
</fn></p>
|
16
|
-
<p>C.<fn reference="1">
|
17
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
|
18
|
-
</fn></p>
|
19
|
-
</foreword>
|
20
|
-
</preface>
|
21
|
-
</iso-standard>
|
22
|
-
INPUT
|
23
|
-
#{HTML_HDR}
|
24
|
-
<br/>
|
25
|
-
<div>
|
26
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
27
|
-
<p>
|
28
|
-
A.
|
29
|
-
<a class='FootnoteRef' href='#fn:2'>
|
30
|
-
<sup>2</sup>
|
31
|
-
</a>
|
32
|
-
</p>
|
33
|
-
<p>
|
34
|
-
B.
|
35
|
-
<a class='FootnoteRef' href='#fn:2'>
|
36
|
-
<sup>2</sup>
|
37
|
-
</a>
|
38
|
-
</p>
|
39
|
-
<p>
|
40
|
-
C.
|
41
|
-
<a class='FootnoteRef' href='#fn:1'>
|
42
|
-
<sup>1</sup>
|
43
|
-
</a>
|
44
|
-
</p>
|
45
|
-
</div>
|
46
|
-
<p class="zzSTDTitle1"/>
|
47
|
-
<aside id="fn:2" class="footnote">
|
48
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
|
49
|
-
</aside>
|
50
|
-
<aside id="fn:1" class="footnote">
|
51
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
|
52
|
-
</aside>
|
53
|
-
</div>
|
54
|
-
</body>
|
55
|
-
</html>
|
56
|
-
OUTPUT
|
57
|
-
end
|
58
|
-
|
59
|
-
it "processes IsoXML footnotes (Word)" do
|
60
|
-
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).gsub(/_Ref\d+/, "_Ref"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
61
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
62
|
-
<preface>
|
63
|
-
<foreword>
|
64
|
-
<p>A.<fn reference="2">
|
65
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
|
66
|
-
</fn></p>
|
67
|
-
<p>B.<fn reference="2">
|
68
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Formerly denoted as 15 % (m/m).</p>
|
69
|
-
</fn></p>
|
70
|
-
<p>C.<fn reference="1">
|
71
|
-
<p id="_1e228e29-baef-4f38-b048-b05a051747e4">Hello! denoted as 15 % (m/m).</p>
|
72
|
-
</fn></p>
|
73
|
-
</foreword>
|
74
|
-
</preface>
|
75
|
-
</iso-standard>
|
76
|
-
INPUT
|
77
|
-
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
78
|
-
<head>
|
79
|
-
<style>
|
80
|
-
</style>
|
81
|
-
</head>
|
82
|
-
<body lang='EN-US' link='blue' vlink='#954F72'>
|
83
|
-
<div class='WordSection1'>
|
84
|
-
<p> </p>
|
85
|
-
</div>
|
86
|
-
<p>
|
87
|
-
<br clear='all' class='section'/>
|
88
|
-
</p>
|
89
|
-
<div class='WordSection2'>
|
90
|
-
<p>
|
91
|
-
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
92
|
-
</p>
|
93
|
-
<div>
|
94
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
95
|
-
<p>
|
96
|
-
A.
|
97
|
-
<span style='mso-bookmark:_Ref'>
|
98
|
-
<a href='#ftn2' epub:type='footnote' class='FootnoteRef'>
|
99
|
-
<sup>2</sup>
|
100
|
-
</a>
|
101
|
-
</span>
|
102
|
-
</p>
|
103
|
-
<p>
|
104
|
-
B.
|
105
|
-
<span style='mso-element:field-begin'/>
|
106
|
-
NOTEREF _Ref \\f \\h
|
107
|
-
<span style='mso-element:field-separator'/>
|
108
|
-
<span class='MsoFootnoteReference'>2</span>
|
109
|
-
<span style='mso-element:field-end'/>
|
110
|
-
</p>
|
111
|
-
<p>
|
112
|
-
C.
|
113
|
-
<span style='mso-bookmark:_Ref'>
|
114
|
-
<a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
|
115
|
-
<sup>1</sup>
|
116
|
-
</a>
|
117
|
-
</span>
|
118
|
-
</p>
|
119
|
-
</div>
|
120
|
-
<p> </p>
|
121
|
-
</div>
|
122
|
-
<p>
|
123
|
-
<br clear='all' class='section'/>
|
124
|
-
</p>
|
125
|
-
<div class='WordSection3'>
|
126
|
-
<p class='zzSTDTitle1'/>
|
127
|
-
<aside id='ftn2'>
|
128
|
-
<p id='_1e228e29-baef-4f38-b048-b05a051747e4'>Formerly denoted as 15 % (m/m).</p>
|
129
|
-
</aside>
|
130
|
-
<aside id='ftn1'>
|
131
|
-
<p id='_1e228e29-baef-4f38-b048-b05a051747e4'>Hello! denoted as 15 % (m/m).</p>
|
132
|
-
</aside>
|
133
|
-
</div>
|
134
|
-
</body>
|
135
|
-
</html>
|
136
|
-
OUTPUT
|
137
|
-
end
|
138
|
-
|
139
|
-
it "processes IsoXML reviewer notes (HTML)" do
|
140
|
-
FileUtils.rm_f "test.html"
|
141
|
-
IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("test", <<~"INPUT", false)
|
142
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
143
|
-
<preface>
|
144
|
-
<foreword>
|
145
|
-
<p id="A">A.</p>
|
146
|
-
<p id="B">B.</p>
|
147
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c711" date="20170101T0000" from="A" to="B"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c07">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
148
|
-
<p id="_f1a8b9da-ca75-458b-96fa-d4af7328975e">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review>
|
149
|
-
<p id="C">C.</p>
|
150
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="C" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
|
151
|
-
</foreword>
|
152
|
-
<introduction><title>Introduction</title>
|
153
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="A" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
|
154
|
-
</introduction>
|
155
|
-
</preface>
|
156
|
-
</iso-standard>
|
157
|
-
INPUT
|
158
|
-
html = File.read("test.html").sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>")
|
159
|
-
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
160
|
-
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
161
|
-
<br />
|
162
|
-
<div>
|
163
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
164
|
-
<p id="A">A.</p>
|
165
|
-
<p id="B">B.</p>
|
166
|
-
<p id="C">C.</p>
|
167
|
-
</div>
|
168
|
-
<br />
|
169
|
-
<div class="Section3" id="">
|
170
|
-
<h1 class="IntroTitle">Introduction</h1>
|
171
|
-
</div>
|
172
|
-
<p class="zzSTDTitle1"></p>
|
173
|
-
</main>
|
174
|
-
OUTPUT
|
175
|
-
end
|
176
|
-
|
177
|
-
it "processes IsoXML reviewer notes (Word)" do
|
178
|
-
FileUtils.rm_f "test.doc"
|
179
|
-
IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss"}).convert("test", <<~"INPUT", false)
|
180
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
181
|
-
<preface>
|
182
|
-
<foreword>
|
183
|
-
<p id="A">A.</p>
|
184
|
-
<p id="B">B.</p>
|
185
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c711" date="20170101T0000" from="A" to="B"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c07">A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
186
|
-
<p id="_f1a8b9da-ca75-458b-96fa-d4af7328975e">For further information on the Foreword, see <strong>ISO/IEC Directives, Part 2, 2016, Clause 12.</strong></p></review>
|
187
|
-
<p id="C">C.</p>
|
188
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="C" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
|
189
|
-
</foreword>
|
190
|
-
<introduction><title>Introduction</title>
|
191
|
-
<review reviewer="ISO" id="_4f4dff63-23c1-4ecb-8ac6-d3ffba93c712" date="20170108T0000" from="A" to="C"><p id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08">Second note.</p></review>
|
192
|
-
</introduction>
|
193
|
-
</preface>
|
194
|
-
</iso-standard>
|
195
|
-
INPUT
|
196
|
-
html = File.read("test.doc").sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>")
|
197
|
-
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
198
|
-
<body lang="EN-US" link="blue" vlink="#954F72" xml:lang="EN-US">
|
199
|
-
<div class="WordSection1">
|
200
|
-
<p class="MsoNormal"> </p>
|
201
|
-
</div>
|
202
|
-
<p class="MsoNormal"><br clear="all" class="section"/></p>
|
203
|
-
<div class="WordSection2">
|
204
|
-
<p class="MsoNormal"><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
|
205
|
-
<div>
|
206
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
207
|
-
<span style="MsoCommentReference" target="1" class="commentLink" from="A" to="B">
|
208
|
-
<span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB">
|
209
|
-
<a style="mso-comment-reference:SMC_1;mso-comment-date:20170101T0000"><span style="MsoCommentReference" target="3" class="commentLink" from="A" to="C">
|
210
|
-
<span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB">
|
211
|
-
<a style="mso-comment-reference:SMC_3;mso-comment-date:20170108T0000"><p class="MsoNormal"><a name="A" id="A"></a>A.</p></a>
|
212
|
-
<span style="mso-comment-continuation:3"><span style="mso-special-character:comment" target="3"></span></span>
|
213
|
-
</span>
|
214
|
-
</span></a>
|
215
|
-
<span style="mso-comment-continuation:3"><span style="mso-comment-continuation:1"><span style="mso-special-character:comment" target="1"></span></span></span>
|
216
|
-
</span>
|
217
|
-
</span>
|
218
|
-
<span style="mso-comment-continuation:3"><span style="mso-comment-continuation:1"><p class="MsoNormal"><a name="B" id="B"></a>B.</p></span></span>
|
219
|
-
|
220
|
-
<span style="MsoCommentReference" target="2" class="commentLink" from="C" to="C">
|
221
|
-
<span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB">
|
222
|
-
<a style="mso-comment-reference:SMC_2;mso-comment-date:20170108T0000"><span style="mso-comment-continuation:3"><p class="MsoNormal"><a name="C" id="C"></a>C.</p></span></a>
|
223
|
-
<span style="mso-special-character:comment" target="2"></span>
|
224
|
-
</span>
|
225
|
-
</span>
|
226
|
-
|
227
|
-
</div>
|
228
|
-
<p class="MsoNormal"><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
|
229
|
-
<div class="Section3" id="">
|
230
|
-
<h1 class="IntroTitle">Introduction</h1>
|
231
|
-
|
232
|
-
</div>
|
233
|
-
<p class="MsoNormal"> </p>
|
234
|
-
</div>
|
235
|
-
<p class="MsoNormal"><br clear="all" class="section"/></p>
|
236
|
-
<div class="WordSection3">
|
237
|
-
<p class="zzSTDTitle1"></p>
|
238
|
-
<div style="mso-element:comment-list"><div style="mso-element:comment"><a name="3" id="3"></a>
|
239
|
-
<span style="mso-comment-author:"ISO""></span>
|
240
|
-
|
241
|
-
<p class="MsoCommentText"><a name="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08" id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08"></a><span style="MsoCommentReference">
|
242
|
-
<span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB">
|
243
|
-
<span style="mso-special-character:comment"></span>
|
244
|
-
</span>
|
245
|
-
</span>Second note.</p>
|
246
|
-
</div>
|
247
|
-
<div style="mso-element:comment"><a name="1" id="1"></a><span style="mso-comment-author:"ISO""></span><p class="MsoCommentText"><a name="_c54b9549-369f-4f85-b5b2-9db3fd3d4c07" id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c07"></a><span style="MsoCommentReference"><span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB"><span style="mso-special-character:comment"></span></span></span>A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.</p>
|
248
|
-
<p class="MsoCommentText"><a name="_f1a8b9da-ca75-458b-96fa-d4af7328975e" id="_f1a8b9da-ca75-458b-96fa-d4af7328975e"></a>For further information on the Foreword, see <b>ISO/IEC Directives, Part 2, 2016, Clause 12.</b></p></div>
|
249
|
-
<div style="mso-element:comment"><a name="2" id="2"></a>
|
250
|
-
<span style="mso-comment-author:"ISO""></span>
|
251
|
-
|
252
|
-
<p class="MsoCommentText"><a name="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08" id="_c54b9549-369f-4f85-b5b2-9db3fd3d4c08"></a><span style="MsoCommentReference">
|
253
|
-
<span lang="EN-GB" style="font-size:9.0pt" xml:lang="EN-GB">
|
254
|
-
<span style="mso-special-character:comment"></span>
|
255
|
-
</span>
|
256
|
-
</span>Second note.</p>
|
257
|
-
</div></div>
|
258
|
-
</div>
|
259
|
-
<div style="mso-element:footnote-list"/></body>
|
260
|
-
OUTPUT
|
261
|
-
end
|
262
|
-
|
263
|
-
|
264
|
-
end
|
data/spec/isodoc/form_spec.rb
DELETED
@@ -1,160 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe IsoDoc do
|
4
|
-
it "renders form" do
|
5
|
-
input = <<~INPUT
|
6
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
<sections>
|
8
|
-
<clause id="A">
|
9
|
-
<form action="/action_page.php" id="F0" name="F1" class="C">
|
10
|
-
<label for="fname">First name:</label><br/>
|
11
|
-
<input type="text" id="fname" name="fname"/><br/>
|
12
|
-
<label for="lname">Last name:</label><br/>
|
13
|
-
<input type="text" id="lname" name="lname"/><br/>
|
14
|
-
<label for="pwd">Password:</label><br/>
|
15
|
-
<input type="password" id="pwd" name="pwd"/><br/>
|
16
|
-
<input type="radio" id="male" name="gender" value="male"/>
|
17
|
-
<label for="male">Male</label><br/>
|
18
|
-
<input type="radio" id="female" name="gender" value="female"/>
|
19
|
-
<label for="female">Female</label><br/>
|
20
|
-
<input type="radio" id="other" name="gender" value="other"/>
|
21
|
-
<label for="other">Other</label><br/>
|
22
|
-
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike" checked="true"/>
|
23
|
-
<label for="vehicle1"> I have a bike</label><br/>
|
24
|
-
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car"/>
|
25
|
-
<label for="vehicle2"> I have a car</label><br/>
|
26
|
-
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat"/>
|
27
|
-
<label for="vehicle3"> I have a boat</label><br/>
|
28
|
-
<input type="date" id="birthday" name="birthday"/><br/>
|
29
|
-
<label for="myfile">Select a file:</label>
|
30
|
-
<input type="file" id="myfile" name="myfile"/><br/>
|
31
|
-
<label for="cars">Select a car:</label>
|
32
|
-
<select id="cars" name="cars" value="fiat">
|
33
|
-
<option value="volvo">Volvo</option>
|
34
|
-
<option value="saab">Saab</option>
|
35
|
-
<option value="fiat">Fiat</option>
|
36
|
-
<option value="audi">Audi</option>
|
37
|
-
</select>
|
38
|
-
<textarea id="t1" name="message" rows="10" cols="30" value="The cat was playing in the garden."/>
|
39
|
-
<input type="button" value="Click Me!"/>
|
40
|
-
<input type="button"/>
|
41
|
-
<input type="submit" value="Submit"/>
|
42
|
-
</form>
|
43
|
-
</clause>
|
44
|
-
</sections>
|
45
|
-
</iso-standard>
|
46
|
-
INPUT
|
47
|
-
|
48
|
-
html = <<~HTML
|
49
|
-
#{HTML_HDR}
|
50
|
-
<p class='zzSTDTitle1'/>
|
51
|
-
<div id='A'>
|
52
|
-
<h1/>
|
53
|
-
<form id='F0' name='F1' action='/action_page.php' class="C">
|
54
|
-
<label for='fname'>First name:</label>
|
55
|
-
<br/>
|
56
|
-
<input id='fname' name='fname' type='text'/>
|
57
|
-
<br/>
|
58
|
-
<label for='lname'>Last name:</label>
|
59
|
-
<br/>
|
60
|
-
<input id='lname' name='lname' type='text'/>
|
61
|
-
<br/>
|
62
|
-
<label for='pwd'>Password:</label>
|
63
|
-
<br/>
|
64
|
-
<input id='pwd' name='pwd' type='password'/>
|
65
|
-
<br/>
|
66
|
-
<input id='male' name='gender' type='radio' value='male'/>
|
67
|
-
<label for='male'>Male</label>
|
68
|
-
<br/>
|
69
|
-
<input id='female' name='gender' type='radio' value='female'/>
|
70
|
-
<label for='female'>Female</label>
|
71
|
-
<br/>
|
72
|
-
<input id='other' name='gender' type='radio' value='other'/>
|
73
|
-
<label for='other'>Other</label>
|
74
|
-
<br/>
|
75
|
-
<input id='vehicle1' name='vehicle1' type='checkbox' value='Bike' checked='true'/>
|
76
|
-
<label for='vehicle1'> I have a bike</label>
|
77
|
-
<br/>
|
78
|
-
<input id='vehicle2' name='vehicle2' type='checkbox' value='Car'/>
|
79
|
-
<label for='vehicle2'> I have a car</label>
|
80
|
-
<br/>
|
81
|
-
<input id='vehicle3' name='vehicle3' type='checkbox' value='Boat'/>
|
82
|
-
<label for='vehicle3'> I have a boat</label>
|
83
|
-
<br/>
|
84
|
-
<input id='birthday' name='birthday' type='date'/>
|
85
|
-
<br/>
|
86
|
-
<label for='myfile'>Select a file:</label>
|
87
|
-
<input id='myfile' name='myfile' type='file'/>
|
88
|
-
<br/>
|
89
|
-
<label for='cars'>Select a car:</label>
|
90
|
-
<select id='cars' name='cars'>
|
91
|
-
<option value='volvo'>Volvo</option>
|
92
|
-
<option value='saab'>Saab</option>
|
93
|
-
<option selected='true' value='fiat'>Fiat</option>
|
94
|
-
<option value='audi'>Audi</option>
|
95
|
-
</select>
|
96
|
-
<textarea id='t1' name='message' rows='10' cols='30'>The cat was playing in the garden.</textarea>
|
97
|
-
<input type='button' value='Click Me!'/>
|
98
|
-
<input type='button'/>
|
99
|
-
<input type='submit' value='Submit'/>
|
100
|
-
</form>
|
101
|
-
</div>
|
102
|
-
</div>
|
103
|
-
</body>
|
104
|
-
</html>
|
105
|
-
HTML
|
106
|
-
|
107
|
-
doc = <<~DOC
|
108
|
-
#{WORD_HDR}
|
109
|
-
<p class='zzSTDTitle1'/>
|
110
|
-
<div id='A'>
|
111
|
-
<h1/>
|
112
|
-
<div class="C" id="F0">
|
113
|
-
First name:
|
114
|
-
<br/>
|
115
|
-
__________
|
116
|
-
<br/>
|
117
|
-
Last name:
|
118
|
-
<br/>
|
119
|
-
__________
|
120
|
-
<br/>
|
121
|
-
Password:
|
122
|
-
<br/>
|
123
|
-
__________
|
124
|
-
<br/>
|
125
|
-
◎ Male
|
126
|
-
<br/>
|
127
|
-
◎ Female
|
128
|
-
<br/>
|
129
|
-
◎ Other
|
130
|
-
<br/>
|
131
|
-
☐ I have a bike
|
132
|
-
<br/>
|
133
|
-
☐ I have a car
|
134
|
-
<br/>
|
135
|
-
☐ I have a boat
|
136
|
-
<br/>
|
137
|
-
__________
|
138
|
-
<br/>
|
139
|
-
Select a file: __________
|
140
|
-
<br/>
|
141
|
-
Select a car: __________
|
142
|
-
<table border='1' width='50%'>
|
143
|
-
<tr>
|
144
|
-
<td/>
|
145
|
-
</tr>
|
146
|
-
</table>
|
147
|
-
[Click Me!] [BUTTON]
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
</div>
|
151
|
-
</body>
|
152
|
-
</html>
|
153
|
-
DOC
|
154
|
-
|
155
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
156
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(html)
|
157
|
-
expect(xmlpp(IsoDoc::WordConvert.new({})
|
158
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(doc)
|
159
|
-
end
|
160
|
-
end
|