xhtml 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +3 -0
  3. data/README.md +11 -0
  4. data/TODO +1 -0
  5. data/lib/xhtml.rb +3607 -0
  6. metadata +55 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ data.tar.gz: 6bc2db51a86b2c75b94d441eb7191580fcb3ed2a
4
+ metadata.gz: 4dd2ff8ad78152a836b781f1491c38b8ac3b5a28
5
+ SHA512:
6
+ data.tar.gz: 571bcd4f8424d3e448e55947e8a956f833238543d8e6c17adec658fd6eb9e92d91f72e8f105d387d341ddae80b4dad7fb00d233f2e3398c019868d8c290a83fa
7
+ metadata.gz: 43d72c2733befa7ce9c7cc5f13f97a18540d285a3b6c892e335ccfcb93126ef77a2dd3a445fce9d1be255adc02a7fe6f9a245c250d7129d2a160cddeb761aab3
@@ -0,0 +1,3 @@
1
+ Version 0.0.1: Release Gem
2
+ Version 0.0.2: Changed homepage URL
3
+ Version 0.0.3: Added README.md
@@ -0,0 +1,11 @@
1
+ File: README.md
2
+
3
+ ## xhtml
4
+
5
+ xhtml is a gem to build xhtml sites, much in the same way CGI builds HTML sites.
6
+
7
+ ## Usage
8
+
9
+ Require the Gem:
10
+
11
+ require 'xhtml'
data/TODO ADDED
@@ -0,0 +1 @@
1
+ Add checks and requirements for functions (ex table needs at least one tr, etc etc)
@@ -0,0 +1,3607 @@
1
+ require 'cgi'
2
+ require 'cgi/session'
3
+
4
+ class XHTML
5
+ def initialize
6
+ @xhtml_cgi_output = ''
7
+ end
8
+ def header (options = {})
9
+ unless not options[:charset].nil?
10
+ options[:charset] = 'UTF-8'
11
+ end
12
+ unless not options[:content].nil?
13
+ options[:content] = 'text/html;charset=UTF-8'
14
+ end
15
+ @xhtml_cgi_output << '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
16
+ @xhtml_cgi_output << "\n"
17
+ @xhtml_cgi_output << '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
18
+ @xhtml_cgi_output << "\n<html xmlns='http://www.w3.org/1999/xhtml'>\n"
19
+ @xhtml_cgi_output << " <head>\n"
20
+ unless options[:base].nil?
21
+ @xhtml_cgi_output << " <base href='#{options[:base]}' />\n"
22
+ end
23
+ unless options[:style].nil?
24
+ options[:style].each do |x|
25
+ @xhtml_cgi_output << " <link rel='stylesheet' type='text/css' href='#{x}' />\n"
26
+ end
27
+ end
28
+ unless options[:script].nil?
29
+ options[:script].each do |x|
30
+ @xhtml_cgi_output << " <script src='#{x}' type='text/javascript'></script>\n"
31
+ end
32
+ end
33
+ unless options[:contact].nil?
34
+ @xhtml_cgi_output << " <link rev='made' href='mailto:#{options[:contact]}' />\n"
35
+ end
36
+ unless options[:keywords].nil?
37
+ @xhtml_cgi_output << " <meta name='keywords' content='#{options[:keywords]}' />\n"
38
+ end
39
+ unless options[:author].nil?
40
+ @xhtml_cgi_output << " <meta name='author' content='#{options[:author]}' />\n"
41
+ end
42
+ unless options[:description].nil?
43
+ @xhtml_cgi_output << " <meta name='description' content='#{options[:description]}' />\n"
44
+ end
45
+ @xhtml_cgi_output << " <meta name='charset' content='#{options[:charset]}' />\n"
46
+ @xhtml_cgi_output << " <meta http-equiv='Content-type' content='#{options[:content]}' />\n"
47
+ @xhtml_cgi_output << " </head>\n"
48
+ end
49
+ def body(content, options = {})
50
+ opts = ['onload', 'onunload', 'class', 'id', 'title', 'onclick',
51
+ 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover',
52
+ 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown',
53
+ 'onkeyup', 'style']
54
+ if options.nil?
55
+ @xhtml_cgi_output << " <body>\n\n"
56
+ else
57
+ @xhtml_cgi_output << " <body"
58
+ options.each do |x,y|
59
+ x = x.to_s
60
+ if opts.include?("#{x}")
61
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
62
+ z = y.join(' ')
63
+ @xhtml_cgi_output << " #{x}='#{z}'"
64
+ else
65
+ @xhtml_cgi_output << " #{x}='#{y}'"
66
+ end
67
+ end
68
+ end
69
+ @xhtml_cgi_output << ">\n\n"
70
+ end
71
+ @xhtml_cgi_output << "#{content}\n"
72
+ @xhtml_cgi_output << " </body>\n"
73
+ end
74
+ def end
75
+ @xhtml_cgi_output << "</html>"
76
+ print @xhtml_cgi_output
77
+ end
78
+ def a(link, desc, options = {})
79
+ out = ''
80
+ opts = ['accesskey', 'charset', 'coords', 'hreflang', 'onblur',
81
+ 'onfocus', 'rel', 'rev', 'shape', 'tabindex', 'type',
82
+ 'class', 'id', 'style', 'title', 'onclick', 'ondblclick',
83
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
84
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
85
+ if options.nil?
86
+ out << "<a href='#{link}'>#{desc}</a>\n"
87
+ else
88
+ out << "<a href='#{link}'"
89
+ options.each do |x,y|
90
+ x = x.to_s
91
+ if opts.include?("#{x}")
92
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
93
+ z = y.join(' ')
94
+ out << " #{x}='#{z}'"
95
+ else
96
+ out << " #{x}='#{y}'"
97
+ end
98
+ end
99
+ end
100
+ out << ">#{desc}</a>\n"
101
+ end
102
+ return out
103
+ end
104
+ def img(src, options = {})
105
+ out = '';
106
+ opts = ['alt', 'height', 'width', 'ismap', 'longdesc', 'usemap',
107
+ 'class', 'id', 'title', 'style', 'onclick', 'ondblclick',
108
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
109
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
110
+ if options.nil?
111
+ out << "<img src='#{src}' />"
112
+ else
113
+ out << "<img src='#{src}'"
114
+ options.each do |x,y|
115
+ x = x.to_s
116
+ if opts.include?("#{x}")
117
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
118
+ z = y.join(' ')
119
+ out << " #{x}='#{z}'"
120
+ else
121
+ out << " #{x}='#{y}'"
122
+ end
123
+ end
124
+ end
125
+ out << " />\n"
126
+ end
127
+ return out
128
+ end
129
+ def table(content, options = {})
130
+ out = '';
131
+ opts = ['border', 'cellpadding', 'cellspacing', 'summary', 'width',
132
+ 'frame', 'rules', 'class', 'id', 'title', 'style', 'onclick',
133
+ 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
134
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
135
+ 'onmouseout']
136
+ if options.nil?
137
+ out << "<table>#{content}</table>\n"
138
+ else
139
+ out << "<table"
140
+ options.each do |x,y|
141
+ x = x.to_s
142
+ if opts.include?("#{x}")
143
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
144
+ z = y.join(' ')
145
+ out << " #{x}='#{z}'"
146
+ else
147
+ out << " #{x}='#{y}'"
148
+ end
149
+ end
150
+ end
151
+ out << ">#{content}</table>\n"
152
+ end
153
+ return out
154
+ end
155
+ def start_table(options = {})
156
+ out = '';
157
+ opts = ['border', 'cellpadding', 'cellspacing', 'summary', 'width',
158
+ 'frame', 'rules', 'class', 'id', 'title', 'style', 'onclick',
159
+ 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
160
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
161
+ 'onmouseout']
162
+ if options.nil?
163
+ out << "<table>\n"
164
+ else
165
+ out << "<table"
166
+ options.each do |x,y|
167
+ x = x.to_s
168
+ if opts.include?("#{x}")
169
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
170
+ z = y.join(' ')
171
+ out << " #{x}='#{z}'"
172
+ else
173
+ out << " #{x}='#{y}'"
174
+ end
175
+ end
176
+ end
177
+ out << ">\n"
178
+ end
179
+ return out
180
+ end
181
+ def end_table
182
+ out = ''
183
+ out << "</table>\n"
184
+ return out
185
+ end
186
+ def tr(content, options = {})
187
+ out = '';
188
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
189
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
190
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
191
+ 'onmousemove', 'onmouseout']
192
+ if options.nil?
193
+ out << "<tr>#{content}</tr>\n"
194
+ else
195
+ out << "<tr"
196
+ options.each do |x,y|
197
+ x = x.to_s
198
+ if opts.include?("#{x}")
199
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
200
+ z = y.join(' ')
201
+ out << " #{x}='#{z}'"
202
+ else
203
+ out << " #{x}='#{y}'"
204
+ end
205
+ end
206
+ end
207
+ out << ">#{content}</tr>\n"
208
+ end
209
+ return out
210
+ end
211
+ def start_tr(options = {})
212
+ out = '';
213
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
214
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
215
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
216
+ 'onmousemove', 'onmouseout']
217
+ if options.nil?
218
+ out << "<tr>\n"
219
+ else
220
+ out << "<tr"
221
+ options.each do |x,y|
222
+ x = x.to_s
223
+ if opts.include?("#{x}")
224
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
225
+ z = y.join(' ')
226
+ out << " #{x}='#{z}'"
227
+ else
228
+ out << " #{x}='#{y}'"
229
+ end
230
+ end
231
+ end
232
+ out << ">\n"
233
+ end
234
+ return out
235
+ end
236
+ def end_tr
237
+ out = ''
238
+ out << "</tr>\n"
239
+ return out
240
+ end
241
+ def td(content, options = {})
242
+ out = '';
243
+ opts = ['align', 'colspan', 'headers', 'rowspan', 'valign', 'axis',
244
+ 'char', 'class', 'id', 'title', 'id', 'onclick', 'ondblclick',
245
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
246
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
247
+ if options.nil?
248
+ out << "<td>#{content}</td>\n"
249
+ else
250
+ out << "<td"
251
+ options.each do |x,y|
252
+ x = x.to_s
253
+ if opts.include?("#{x}")
254
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
255
+ z = y.join(' ')
256
+ out << " #{x}='#{z}'"
257
+ else
258
+ out << " #{x}='#{y}'"
259
+ end
260
+ end
261
+ end
262
+ out << ">#{content}</td>\n";
263
+ end
264
+ return out
265
+ end
266
+ def start_td(options = {})
267
+ out = '';
268
+ opts = ['align', 'colspan', 'headers', 'rowspan', 'valign', 'axis',
269
+ 'char', 'class', 'id', 'title', 'id', 'onclick', 'ondblclick',
270
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
271
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
272
+ if options.nil?
273
+ out << "<td>\n"
274
+ else
275
+ out << "<td"
276
+ options.each do |x,y|
277
+ x = x.to_s
278
+ if opts.include?("#{x}")
279
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
280
+ z = y.join(' ')
281
+ out << " #{x}='#{z}'"
282
+ else
283
+ out << " #{x}='#{y}'"
284
+ end
285
+ end
286
+ end
287
+ out << ">\n"
288
+ end
289
+ return out
290
+ end
291
+ def end_td
292
+ out = ''
293
+ out << "</tr>\n"
294
+ return out
295
+ end
296
+ def th(content, options = {})
297
+ out = '';
298
+ opts = ['abbr', 'align', 'colspan', 'rowspan', 'valign', 'axis',
299
+ 'char', 'charoff', 'scope', 'class', 'id', 'title', 'style',
300
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
301
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
302
+ 'onmouseout']
303
+ if options.nil?
304
+ out << "<th>#{content}</th>\n"
305
+ else
306
+ out << "<th"
307
+ options.each do |x,y|
308
+ x = x.to_s
309
+ if opts.include?("#{x}")
310
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
311
+ z = y.join(' ')
312
+ out << " #{x}='#{z}'"
313
+ else
314
+ out << " #{x}='#{y}'"
315
+ end
316
+ end
317
+ end
318
+ out << ">#{content}</th>\n";
319
+ end
320
+ return out
321
+ end
322
+ def start_th(options = {})
323
+ out = '';
324
+ opts = ['abbr', 'align', 'colspan', 'rowspan', 'valign', 'axis',
325
+ 'char', 'charoff', 'scope', 'class', 'id', 'title', 'style',
326
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
327
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
328
+ 'onmouseout']
329
+ if options.nil?
330
+ out << "<th>\n"
331
+ else
332
+ out << "<th"
333
+ options.each do |x,y|
334
+ x = x.to_s
335
+ if opts.include?("#{x}")
336
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
337
+ z = y.join(' ')
338
+ out << " #{x}='#{z}'"
339
+ else
340
+ out << " #{x}='#{y}'"
341
+ end
342
+ end
343
+ end
344
+ out << ">\n";
345
+ end
346
+ return out
347
+ end
348
+ def end_th
349
+ out = ''
350
+ out << "</th>\n"
351
+ return out
352
+ end
353
+ def thead(content, options = {})
354
+ out = '';
355
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
356
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
357
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
358
+ 'onmousemove', 'onmouseout']
359
+ if options.nil?
360
+ out << "<thead>#{content}</thead>\n"
361
+ else
362
+ out << "<thead"
363
+ options.each do |x,y|
364
+ x = x.to_s
365
+ if opts.include?("#{x}")
366
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
367
+ z = y.join(' ')
368
+ out << " #{x}='#{z}'"
369
+ else
370
+ out << " #{x}='#{y}'"
371
+ end
372
+ end
373
+ end
374
+ out << ">#{content}</thead>\n"
375
+ end
376
+ return out
377
+ end
378
+ def start_thead(options = {})
379
+ out = '';
380
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
381
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
382
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
383
+ 'onmousemove', 'onmouseout']
384
+ if options.nil?
385
+ out << "<thead>\n"
386
+ else
387
+ out << "<thead"
388
+ options.each do |x,y|
389
+ x = x.to_s
390
+ if opts.include?("#{x}")
391
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
392
+ z = y.join(' ')
393
+ out << " #{x}='#{z}'"
394
+ else
395
+ out << " #{x}='#{y}'"
396
+ end
397
+ end
398
+ end
399
+ out << ">\n"
400
+ end
401
+ return out
402
+ end
403
+ def end_thead
404
+ out = ''
405
+ out << "</thead>\n"
406
+ return out
407
+ end
408
+ def tbody(content, options = {})
409
+ out = '';
410
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
411
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
412
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
413
+ 'onmousemove', 'onmouseout']
414
+ if options.nil?
415
+ out << "<tbody>#{content}</tbody>\n"
416
+ else
417
+ out << "<tbody"
418
+ options.each do |x,y|
419
+ x = x.to_s
420
+ if opts.include?("#{x}")
421
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
422
+ z = y.join(' ')
423
+ out << " #{x}='#{z}'"
424
+ else
425
+ out << " #{x}='#{y}'"
426
+ end
427
+ end
428
+ end
429
+ out << ">#{content}</tbody>\n"
430
+ end
431
+ return out
432
+ end
433
+ def start_tbody(options = {})
434
+ out = '';
435
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
436
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
437
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
438
+ 'onmousemove', 'onmouseout']
439
+ if options.nil?
440
+ out << "<tbody>\n"
441
+ else
442
+ out << "<tbody"
443
+ options.each do |x,y|
444
+ x = x.to_s
445
+ if opts.include?("#{x}")
446
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
447
+ z = y.join(' ')
448
+ out << " #{x}='#{z}'"
449
+ else
450
+ out << " #{x}='#{y}'"
451
+ end
452
+ end
453
+ end
454
+ out << ">\n"
455
+ end
456
+ return out
457
+ end
458
+ def end_tbody
459
+ out = ''
460
+ out << "</tbody>\n"
461
+ return out
462
+ end
463
+ def tfoot(content, options = {})
464
+ out = '';
465
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
466
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
467
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
468
+ 'onmousemove', 'onmouseout']
469
+ if options.nil?
470
+ out << "<tfoot>#{content}</tfoot>\n"
471
+ else
472
+ out << "<tfoot"
473
+ options.each do |x,y|
474
+ x = x.to_s
475
+ if opts.include?("#{x}")
476
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
477
+ z = y.join(' ')
478
+ out << " #{x}='#{z}'"
479
+ else
480
+ out << " #{x}='#{y}'"
481
+ end
482
+ end
483
+ end
484
+ out << ">#{content}</tfoot>\n"
485
+ end
486
+ return out
487
+ end
488
+ def start_tfoot(options = {})
489
+ out = '';
490
+ opts = ['align', 'valign', 'char', 'charoff', 'class', 'id', 'title',
491
+ 'style', 'onclick', 'ondblclick', 'onkeyup', 'onkeydown',
492
+ 'onkeypress', 'onmousedown', 'onmouseup', 'onmouseover',
493
+ 'onmousemove', 'onmouseout']
494
+ if options.nil?
495
+ out << "<tfoot>\n"
496
+ else
497
+ out << "<tfoot"
498
+ options.each do |x,y|
499
+ x = x.to_s
500
+ if opts.include?("#{x}")
501
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
502
+ z = y.join(' ')
503
+ out << " #{x}='#{z}'"
504
+ else
505
+ out << " #{x}='#{y}'"
506
+ end
507
+ end
508
+ end
509
+ out << ">\n"
510
+ end
511
+ return out
512
+ end
513
+ def end_tfoot
514
+ out = ''
515
+ out << "</tfoot>\n"
516
+ return out
517
+ end
518
+ def caption(content, options = {})
519
+ out = ''
520
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
521
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
522
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
523
+ if options.nil?
524
+ out << "<caption>#{content}</caption>\n"
525
+ else
526
+ out << "<caption"
527
+ options.each do |x,y|
528
+ x = x.to_s
529
+ if opts.include?("#{x}")
530
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
531
+ z = y.join(' ')
532
+ out << " #{x}='#{z}'"
533
+ else
534
+ out << " #{x}='#{y}'"
535
+ end
536
+ end
537
+ end
538
+ out << ">#{content}</caption>\n"
539
+ end
540
+ return out
541
+ end
542
+ def start_caption(options = {})
543
+ out = ''
544
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
545
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
546
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
547
+ if options.nil?
548
+ out << "<caption>\n"
549
+ else
550
+ out << "<caption"
551
+ options.each do |x,y|
552
+ x = x.to_s
553
+ if opts.include?("#{x}")
554
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
555
+ z = y.join(' ')
556
+ out << " #{x}='#{z}'"
557
+ else
558
+ out << " #{x}='#{y}'"
559
+ end
560
+ end
561
+ end
562
+ out << ">\n"
563
+ end
564
+ return out
565
+ end
566
+ def end_caption
567
+ out = ''
568
+ out << "</caption>\n"
569
+ return out
570
+ end
571
+ def col(options = {})
572
+ out = ''
573
+ opts = ['align', 'span', 'valign', 'width', 'char', 'charoff', 'class',
574
+ 'id', 'title', 'style', 'onclick', 'ondblclick', 'onkeyup',
575
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
576
+ 'onmouseover', 'onmousemove', 'onmouseout']
577
+ if options.nil?
578
+ out << "<col />\n"
579
+ else
580
+ out << "<col"
581
+ options.each do |x,y|
582
+ x = x.to_s
583
+ if opts.include?("#{x}")
584
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
585
+ z = y.join(' ')
586
+ out << " #{x}='#{z}'"
587
+ else
588
+ out << " #{x}='#{y}'"
589
+ end
590
+ end
591
+ end
592
+ out << " />\n"
593
+ end
594
+ return out
595
+ end
596
+ def colgroup(content, options = {})
597
+ out = ''
598
+ opts = ['align', 'span', 'valign', 'width', 'char', 'charoff', 'class',
599
+ 'id', 'title', 'style', 'onclick', 'ondblclick', 'onkeyup',
600
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
601
+ 'onmouseover', 'onmousemove', 'onmouseout']
602
+ if options.nil?
603
+ out << "<colgroup>#{content}</colgroup>\n"
604
+ else
605
+ out << "<colgroup"
606
+ options.each do |x,y|
607
+ x = x.to_s
608
+ if opts.include?("#{x}")
609
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
610
+ z = y.join(' ')
611
+ out << " #{x}='#{z}'"
612
+ else
613
+ out << " #{x}='#{y}'"
614
+ end
615
+ end
616
+ end
617
+ out << ">#{content}</colgroup>\n"
618
+ end
619
+ return out
620
+ end
621
+ def start_colgroup(options = {})
622
+ out = ''
623
+ opts = ['align', 'span', 'valign', 'width', 'char', 'charoff', 'class',
624
+ 'id', 'title', 'style', 'onclick', 'ondblclick', 'onkeyup',
625
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
626
+ 'onmouseover', 'onmousemove', 'onmouseout']
627
+ if options.nil?
628
+ out << "<colgroup>\n"
629
+ else
630
+ out << "<colgroup"
631
+ options.each do |x,y|
632
+ x = x.to_s
633
+ if opts.include?("#{x}")
634
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
635
+ z = y.join(' ')
636
+ out << " #{x}='#{z}'"
637
+ else
638
+ out << " #{x}='#{y}'"
639
+ end
640
+ end
641
+ end
642
+ out << ">\n"
643
+ end
644
+ return out
645
+ end
646
+ def end_colgroup
647
+ out = ''
648
+ out << "</colgroup>\n"
649
+ return out
650
+ end
651
+ def h1(content, options = {})
652
+ out = ''
653
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
654
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
655
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
656
+ if options.nil?
657
+ out << "<h1>#{content}</h1>\n"
658
+ else
659
+ out << "<h1"
660
+ options.each do |x,y|
661
+ x = x.to_s
662
+ if opts.include?("#{x}")
663
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
664
+ z = y.join(' ')
665
+ out << " #{x}='#{z}'"
666
+ else
667
+ out << " #{x}='#{y}'"
668
+ end
669
+ end
670
+ end
671
+ out << ">#{content}</h1>\n";
672
+ end
673
+ return out
674
+ end
675
+ def h2(content, options = {})
676
+ out = ''
677
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
678
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
679
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
680
+ if options.nil?
681
+ out << "<h2>#{content}</h2>\n"
682
+ else
683
+ out << "<h2"
684
+ options.each do |x,y|
685
+ x = x.to_s
686
+ if opts.include?("#{x}")
687
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
688
+ z = y.join(' ')
689
+ out << " #{x}='#{z}'"
690
+ else
691
+ out << " #{x}='#{y}'"
692
+ end
693
+ end
694
+ end
695
+ out << ">#{content}</h2>\n";
696
+ end
697
+ return out
698
+ end
699
+ def h3(content, options = {})
700
+ out = ''
701
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
702
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
703
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
704
+ if options.nil?
705
+ out << "<h3>#{content}</h3>\n"
706
+ else
707
+ out << "<h3"
708
+ options.each do |x,y|
709
+ x = x.to_s
710
+ if opts.include?("#{x}")
711
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
712
+ z = y.join(' ')
713
+ out << " #{x}='#{z}'"
714
+ else
715
+ out << " #{x}='#{y}'"
716
+ end
717
+ end
718
+ end
719
+ out << ">#{content}</h3>\n";
720
+ end
721
+ return out
722
+ end
723
+ def h4(content, options = {})
724
+ out = ''
725
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
726
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
727
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
728
+ if options.nil?
729
+ out << "<h4>#{content}</h1>\n"
730
+ else
731
+ out << "<h4"
732
+ options.each do |x,y|
733
+ x = x.to_s
734
+ if opts.include?("#{x}")
735
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
736
+ z = y.join(' ')
737
+ out << " #{x}='#{z}'"
738
+ else
739
+ out << " #{x}='#{y}'"
740
+ end
741
+ end
742
+ end
743
+ out << ">#{content}</h4>\n";
744
+ end
745
+ return out
746
+ end
747
+ def h5(content, options = {})
748
+ out = ''
749
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
750
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
751
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
752
+ if options.nil?
753
+ out << "<h5>#{content}</h5>\n"
754
+ else
755
+ out << "<h5"
756
+ options.each do |x,y|
757
+ x = x.to_s
758
+ if opts.include?("#{x}")
759
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
760
+ z = y.join(' ')
761
+ out << " #{x}='#{z}'"
762
+ else
763
+ out << " #{x}='#{y}'"
764
+ end
765
+ end
766
+ end
767
+ out << ">#{content}</h5>\n";
768
+ end
769
+ return out
770
+ end
771
+ def h6(content, options = {})
772
+ out = ''
773
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
774
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
775
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
776
+ if options.nil?
777
+ out << "<h6>#{content}</h6>\n"
778
+ else
779
+ out << "<h6"
780
+ options.each do |x,y|
781
+ x = x.to_s
782
+ if opts.include?("#{x}")
783
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
784
+ z = y.join(' ')
785
+ out << " #{x}='#{z}'"
786
+ else
787
+ out << " #{x}='#{y}'"
788
+ end
789
+ end
790
+ end
791
+ out << ">#{content}</h6>\n";
792
+ end
793
+ return out
794
+ end
795
+ def start_h1(content, options = {})
796
+ out = ''
797
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
798
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
799
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
800
+ if options.nil?
801
+ out << "<h1>\n"
802
+ else
803
+ out << "<h1"
804
+ options.each do |x,y|
805
+ x = x.to_s
806
+ if opts.include?("#{x}")
807
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
808
+ z = y.join(' ')
809
+ out << " #{x}='#{z}'"
810
+ else
811
+ out << " #{x}='#{y}'"
812
+ end
813
+ end
814
+ end
815
+ out << ">\n";
816
+ end
817
+ return out
818
+ end
819
+ def start_h2(content, options = {})
820
+ out = ''
821
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
822
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
823
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
824
+ if options.nil?
825
+ out << "<h2>\n"
826
+ else
827
+ out << "<h2"
828
+ options.each do |x,y|
829
+ x = x.to_s
830
+ if opts.include?("#{x}")
831
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
832
+ z = y.join(' ')
833
+ out << " #{x}='#{z}'"
834
+ else
835
+ out << " #{x}='#{y}'"
836
+ end
837
+ end
838
+ end
839
+ out << ">\n";
840
+ end
841
+ return out
842
+ end
843
+ def start_h3(content, options = {})
844
+ out = ''
845
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
846
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
847
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
848
+ if options.nil?
849
+ out << "<h3>\n"
850
+ else
851
+ out << "<h3"
852
+ options.each do |x,y|
853
+ x = x.to_s
854
+ if opts.include?("#{x}")
855
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
856
+ z = y.join(' ')
857
+ out << " #{x}='#{z}'"
858
+ else
859
+ out << " #{x}='#{y}'"
860
+ end
861
+ end
862
+ end
863
+ out << ">\n";
864
+ end
865
+ return out
866
+ end
867
+ def start_h4(content, options = {})
868
+ out = ''
869
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
870
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
871
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
872
+ if options.nil?
873
+ out << "<h4>\n"
874
+ else
875
+ out << "<h4"
876
+ options.each do |x,y|
877
+ x = x.to_s
878
+ if opts.include?("#{x}")
879
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
880
+ z = y.join(' ')
881
+ out << " #{x}='#{z}'"
882
+ else
883
+ out << " #{x}='#{y}'"
884
+ end
885
+ end
886
+ end
887
+ out << ">\n";
888
+ end
889
+ return out
890
+ end
891
+ def start_h5(content, options = {})
892
+ out = ''
893
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
894
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
895
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
896
+ if options.nil?
897
+ out << "<h5>\n"
898
+ else
899
+ out << "<h5"
900
+ options.each do |x,y|
901
+ x = x.to_s
902
+ if opts.include?("#{x}")
903
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
904
+ z = y.join(' ')
905
+ out << " #{x}='#{z}'"
906
+ else
907
+ out << " #{x}='#{y}'"
908
+ end
909
+ end
910
+ end
911
+ out << ">\n";
912
+ end
913
+ return out
914
+ end
915
+ def start_h6(options = {})
916
+ out = ''
917
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
918
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
919
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
920
+ if options.nil?
921
+ out << "<h6>\n"
922
+ else
923
+ out << "<h6"
924
+ options.each do |x,y|
925
+ x = x.to_s
926
+ if opts.include?("#{x}")
927
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
928
+ z = y.join(' ')
929
+ out << " #{x}='#{z}'"
930
+ else
931
+ out << " #{x}='#{y}'"
932
+ end
933
+ end
934
+ end
935
+ out << ">\n";
936
+ end
937
+ return out
938
+ end
939
+ def end_h1
940
+ out = ''
941
+ out << "</h1>\n"
942
+ return out
943
+ end
944
+ def end_h2
945
+ out = ''
946
+ out << "</h2>\n"
947
+ return out
948
+ end
949
+ def end_h3
950
+ out = ''
951
+ out << "</h3>\n"
952
+ return out
953
+ end
954
+ def end_h4
955
+ out = ''
956
+ out << "</h4>\n"
957
+ return out
958
+ end
959
+ def end_h5
960
+ out = ''
961
+ out << "</h5>\n"
962
+ return out
963
+ end
964
+ def end_h6
965
+ out = ''
966
+ out << "</h6>\n"
967
+ return out
968
+ end
969
+ def style(content, options = {})
970
+ out = ''
971
+ opts = ['media', 'title', 'type']
972
+ if options.nil?
973
+ out << "<style>\n#{content}\n</style>\n"
974
+ else
975
+ out << "<style"
976
+ options.each do |x,y|
977
+ x = x.to_s
978
+ if opts.include?("#{x}")
979
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
980
+ z = y.join(' ')
981
+ out << " #{x}='#{z}'"
982
+ else
983
+ out << " #{x}='#{y}'"
984
+ end
985
+ end
986
+ end
987
+ out << ">\n#{content}\n</style>\n"
988
+ end
989
+ return out
990
+ end
991
+ def start_style(options = {})
992
+ out = ''
993
+ opts = ['media', 'title', 'type']
994
+ if options.nil?
995
+ out << "<style>\n"
996
+ else
997
+ out << "<style"
998
+ options.each do |x,y|
999
+ x = x.to_s
1000
+ if opts.include?("#{x}")
1001
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1002
+ z = y.join(' ')
1003
+ out << " #{x}='#{z}'"
1004
+ else
1005
+ out << " #{x}='#{y}'"
1006
+ end
1007
+ end
1008
+ end
1009
+ out << ">\n"
1010
+ end
1011
+ return out
1012
+ end
1013
+ def end_style
1014
+ out = ''
1015
+ out << "\n</style>\n"
1016
+ return out
1017
+ end
1018
+ def p(content, options = {})
1019
+ out = ''
1020
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1021
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1022
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1023
+ if options.nil?
1024
+ out << "<p>\n#{content}\n</p>\n"
1025
+ else
1026
+ out << "<p"
1027
+ options.each do |x,y|
1028
+ x = x.to_s
1029
+ if opts.include?("#{x}")
1030
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1031
+ z = y.join(' ')
1032
+ out << " #{x}='#{z}'"
1033
+ else
1034
+ out << " #{x}='#{y}'"
1035
+ end
1036
+ end
1037
+ end
1038
+ out << ">\n#{content}\n</p>\n"
1039
+ end
1040
+ return out
1041
+ end
1042
+ def start_p(optioons = {})
1043
+ out = ''
1044
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1045
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1046
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1047
+ if options.nil?
1048
+ out << "<p>\n"
1049
+ else
1050
+ out << "<p"
1051
+ options.each do |x,y|
1052
+ x = x.to_s
1053
+ if opts.include?("#{x}")
1054
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1055
+ z = y.join(' ')
1056
+ out << " #{x}='#{z}'"
1057
+ else
1058
+ out << " #{x}='#{y}'"
1059
+ end
1060
+ end
1061
+ end
1062
+ out << ">\n"
1063
+ end
1064
+ return out
1065
+ end
1066
+ def end_p
1067
+ out = ''
1068
+ out << "</p>\n"
1069
+ return out
1070
+ end
1071
+ def ol(content, options = {})
1072
+ out = ''
1073
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1074
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1075
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1076
+ if options.nil?
1077
+ out << "<ol>#{content}</ol>\n"
1078
+ else
1079
+ out << "<ol"
1080
+ options.each do |x,y|
1081
+ x = x.to_s
1082
+ if opts.include?("#{x}")
1083
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1084
+ z = y.join(' ')
1085
+ out << " #{x}='#{z}'"
1086
+ else
1087
+ out << " #{x}='#{y}'"
1088
+ end
1089
+ end
1090
+ end
1091
+ out << ">#{content}</ol>\n"
1092
+ end
1093
+ return out
1094
+ end
1095
+ def start_ol(options = {})
1096
+ out = ''
1097
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1098
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1099
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1100
+ if options.nil?
1101
+ out << "<ol>\n"
1102
+ else
1103
+ out << "<ol"
1104
+ options.each do |x,y|
1105
+ x = x.to_s
1106
+ if opts.include?("#{x}")
1107
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1108
+ z = y.join(' ')
1109
+ out << " #{x}='#{z}'"
1110
+ else
1111
+ out << " #{x}='#{y}'"
1112
+ end
1113
+ end
1114
+ end
1115
+ out << ">\n"
1116
+ end
1117
+ return out
1118
+ end
1119
+ def end_ol(options = {})
1120
+ out = ''
1121
+ out << "</ol>\n"
1122
+ return out
1123
+ end
1124
+ def ul(content, options = {})
1125
+ out = ''
1126
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1127
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1128
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1129
+ if options.nil?
1130
+ out << "<ul>#{content}</ul>\n"
1131
+ else
1132
+ out << "<ul"
1133
+ options.each do |x,y|
1134
+ x = x.to_s
1135
+ if opts.include?("#{x}")
1136
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1137
+ z = y.join(' ')
1138
+ out << " #{x}='#{z}'"
1139
+ else
1140
+ out << " #{x}='#{y}'"
1141
+ end
1142
+ end
1143
+ end
1144
+ out << ">#{content}</ul>\n"
1145
+ end
1146
+ return out
1147
+ end
1148
+ def start_ul(options = {})
1149
+ out = ''
1150
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1151
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1152
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1153
+ if options.nil?
1154
+ out << "<ul>\n"
1155
+ else
1156
+ out << "<ul"
1157
+ options.each do |x,y|
1158
+ x = x.to_s
1159
+ if opts.include?("#{x}")
1160
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1161
+ z = y.join(' ')
1162
+ out << " #{x}='#{z}'"
1163
+ else
1164
+ out << " #{x}='#{y}'"
1165
+ end
1166
+ end
1167
+ end
1168
+ out << ">\n"
1169
+ end
1170
+ return out
1171
+ end
1172
+ def end_ul(options = {})
1173
+ out = ''
1174
+ out << "</ol>\n"
1175
+ return out
1176
+ end
1177
+ def li(content, options = {})
1178
+ out = ''
1179
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1180
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1181
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1182
+ if options.nil?
1183
+ out << "<li>#{content}</li>\n"
1184
+ else
1185
+ out << "<li"
1186
+ options.each do |x,y|
1187
+ x = x.to_s
1188
+ if opts.include?("#{x}")
1189
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1190
+ z = y.join(' ')
1191
+ out << " #{x}='#{z}'"
1192
+ else
1193
+ out << " #{x}='#{y}'"
1194
+ end
1195
+ end
1196
+ end
1197
+ out << ">#{content}</li>\n"
1198
+ end
1199
+ return out
1200
+ end
1201
+ def start_li(options = {})
1202
+ out = ''
1203
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1204
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1205
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1206
+ if options.nil?
1207
+ out << "<li>\n"
1208
+ else
1209
+ out << "<li"
1210
+ options.each do |x,y|
1211
+ x = x.to_s
1212
+ if opts.include?("#{x}")
1213
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1214
+ z = y.join(' ')
1215
+ out << " #{x}='#{z}'"
1216
+ else
1217
+ out << " #{x}='#{y}'"
1218
+ end
1219
+ end
1220
+ end
1221
+ out << ">\n"
1222
+ end
1223
+ return out
1224
+ end
1225
+ def end_li
1226
+ out = ''
1227
+ out << "</li>\n"
1228
+ return out
1229
+ end
1230
+ def div(content, options = {})
1231
+ out = ''
1232
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1233
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1234
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1235
+ if options.nil?
1236
+ out << "<div>#{content}</div>\n"
1237
+ else
1238
+ out << "<div"
1239
+ options.each do |x,y|
1240
+ x = x.to_s
1241
+ if opts.include?("#{x}")
1242
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1243
+ z = y.join(' ')
1244
+ out << " #{x}='#{z}'"
1245
+ else
1246
+ out << " #{x}='#{y}'"
1247
+ end
1248
+ end
1249
+ end
1250
+ out << ">#{content}</div>\n"
1251
+ end
1252
+ return out
1253
+ end
1254
+ def start_div(options = {})
1255
+ out = ''
1256
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1257
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1258
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1259
+ if options.nil?
1260
+ out << "<div>\n"
1261
+ else
1262
+ out << "<div"
1263
+ options.each do |x,y|
1264
+ x = x.to_s
1265
+ if opts.include?("#{x}")
1266
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1267
+ z = y.join(' ')
1268
+ out << " #{x}='#{z}'"
1269
+ else
1270
+ out << " #{x}='#{y}'"
1271
+ end
1272
+ end
1273
+ end
1274
+ out << ">"
1275
+ end
1276
+ return out
1277
+ end
1278
+ def end_div
1279
+ out = ''
1280
+ out << "</div>\n"
1281
+ return out
1282
+ end
1283
+ def span(content, options = {})
1284
+ out = ''
1285
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1286
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1287
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1288
+ if options.nil?
1289
+ out << "<span>#{content}</span>\n"
1290
+ else
1291
+ out << "<span"
1292
+ options.each do |x,y|
1293
+ x = x.to_s
1294
+ if opts.include?("#{x}")
1295
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1296
+ z = y.join(' ')
1297
+ out << " #{x}='#{z}'"
1298
+ else
1299
+ out << " #{x}='#{y}'"
1300
+ end
1301
+ end
1302
+ end
1303
+ out << ">#{content}</span>"
1304
+ end
1305
+ return out
1306
+ end
1307
+ def start_span(options = {})
1308
+ out = ''
1309
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1310
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1311
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1312
+ if options.nil?
1313
+ out << "<span>\n"
1314
+ else
1315
+ out << "<span"
1316
+ options.each do |x,y|
1317
+ x = x.to_s
1318
+ if opts.include?("#{x}")
1319
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1320
+ z = y.join(' ')
1321
+ out << " #{x}='#{z}'"
1322
+ else
1323
+ out << " #{x}='#{y}'"
1324
+ end
1325
+ end
1326
+ end
1327
+ out << ">"
1328
+ end
1329
+ return out
1330
+ end
1331
+ def end_span
1332
+ out = ''
1333
+ out << "</span>\n"
1334
+ return out
1335
+ end
1336
+ def abbr(content, options = {})
1337
+ out = ''
1338
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1339
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1340
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1341
+ if options.nil?
1342
+ out << "<abbr>#{content}</abbr>\n"
1343
+ else
1344
+ out << "<abbr"
1345
+ options.each do |x,y|
1346
+ x = x.to_s
1347
+ if opts.include?("#{x}")
1348
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1349
+ z = y.join(' ')
1350
+ out << " #{x}='#{z}'"
1351
+ else
1352
+ out << " #{x}='#{y}'"
1353
+ end
1354
+ end
1355
+ end
1356
+ out << ">#{content}</abbr>\n"
1357
+ end
1358
+ return out
1359
+ end
1360
+ def start_abbr(options = {})
1361
+ out = ''
1362
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1363
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1364
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1365
+ if options.nil?
1366
+ out << "<abbr>\n"
1367
+ else
1368
+ out << "<abbr"
1369
+ options.each do |x,y|
1370
+ x = x.to_s
1371
+ if opts.include?("#{x}")
1372
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1373
+ z = y.join(' ')
1374
+ out << " #{x}='#{z}'"
1375
+ else
1376
+ out << " #{x}='#{y}'"
1377
+ end
1378
+ end
1379
+ end
1380
+ out << ">\n"
1381
+ end
1382
+ return out
1383
+ end
1384
+ def end_abbr
1385
+ out = ''
1386
+ out << "</abbr>\n"
1387
+ return out
1388
+ end
1389
+ def acronym(content, options = {})
1390
+ out = ''
1391
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1392
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1393
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1394
+ if options.nil?
1395
+ out << "<acronym>#{content}</acronym>\n"
1396
+ else
1397
+ out << "<acronym"
1398
+ options.each do |x,y|
1399
+ x = x.to_s
1400
+ if opts.include?("#{x}")
1401
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1402
+ z = y.join(' ')
1403
+ out << " #{x}='#{z}'"
1404
+ else
1405
+ out << " #{x}='#{y}'"
1406
+ end
1407
+ end
1408
+ end
1409
+ out << ">#{content}</acronym>\n"
1410
+ end
1411
+ return out
1412
+ end
1413
+ def start_acronym(options = {})
1414
+ out = ''
1415
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1416
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1417
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1418
+ if options.nil?
1419
+ out << "<acronym>\n"
1420
+ else
1421
+ out << "<acronym"
1422
+ options.each do |x,y|
1423
+ x = x.to_s
1424
+ if opts.include?("#{x}")
1425
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1426
+ z = y.join(' ')
1427
+ out << " #{x}='#{z}'"
1428
+ else
1429
+ out << " #{x}='#{y}'"
1430
+ end
1431
+ end
1432
+ end
1433
+ out << ">\n"
1434
+ end
1435
+ return out
1436
+ end
1437
+ def end_acronym
1438
+ out = ''
1439
+ out << "</acronym>\n"
1440
+ return out
1441
+ end
1442
+ def address(content, options = {})
1443
+ out = ''
1444
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1445
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1446
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1447
+ if options.nil?
1448
+ out << "<address>#{content}</address>\n"
1449
+ else
1450
+ out << "<address"
1451
+ options.each do |x,y|
1452
+ x = x.to_s
1453
+ if opts.include?("#{x}")
1454
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1455
+ z = y.join(' ')
1456
+ out << " #{x}='#{z}'"
1457
+ else
1458
+ out << " #{x}='#{y}'"
1459
+ end
1460
+ end
1461
+ end
1462
+ out << ">#{content}</address>\n"
1463
+ end
1464
+ return out
1465
+ end
1466
+ def start_address(options = {})
1467
+ out = ''
1468
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'style',
1469
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1470
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout']
1471
+ if options.nil?
1472
+ out << "<address>\n"
1473
+ else
1474
+ out << "<address"
1475
+ options.each do |x,y|
1476
+ x = x.to_s
1477
+ if opts.include?("#{x}")
1478
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1479
+ z = y.join(' ')
1480
+ out << " #{x}='#{z}'"
1481
+ else
1482
+ out << " #{x}='#{y}'"
1483
+ end
1484
+ end
1485
+ end
1486
+ out << ">\n"
1487
+ end
1488
+ return out
1489
+ end
1490
+ def end_address
1491
+ out = ''
1492
+ out << "</address>\n"
1493
+ return out
1494
+ end
1495
+ def area(options = {})
1496
+ out = ''
1497
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1498
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1499
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1500
+ 'alt', 'coords', 'shape', 'accesskey', 'onblur', 'onfocus',
1501
+ 'nohref', 'href', 'tabindex', 'style']
1502
+ if not options.nil?
1503
+ out << "<area"
1504
+ options.each do |x,y|
1505
+ x = x.to_s
1506
+ if opts.include?("#{x}")
1507
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1508
+ z = y.join(' ')
1509
+ out << " #{x}='#{z}'"
1510
+ else
1511
+ out << " #{x}='#{y}'"
1512
+ end
1513
+ end
1514
+ end
1515
+ out << " />\n"
1516
+ end
1517
+ return out
1518
+ end
1519
+ def b(content, options = {})
1520
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1521
+ out << " that you use CSS instead of the b element -->\n"
1522
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1523
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1524
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1525
+ 'style']
1526
+ if options.nil?
1527
+ out << "<b>#{content}</b>\n"
1528
+ else
1529
+ out << "<b"
1530
+ options.each do |x,y|
1531
+ x = x.to_s
1532
+ if opts.include?("#{x}")
1533
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1534
+ z = y.join(' ')
1535
+ out << " #{x}='#{z}'"
1536
+ else
1537
+ out << " #{x}='#{y}'"
1538
+ end
1539
+ end
1540
+ end
1541
+ out << ">#{content}</b>\n"
1542
+ end
1543
+ return out
1544
+ end
1545
+ def start_b(options = {})
1546
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1547
+ out << " that you use CSS instead of the b element -->\n"
1548
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1549
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1550
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1551
+ 'style']
1552
+ if options.nil?
1553
+ out << "<b>\n"
1554
+ else
1555
+ out << "<b"
1556
+ options.each do |x,y|
1557
+ x = x.to_s
1558
+ if opts.include?("#{x}")
1559
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1560
+ z = y.join(' ')
1561
+ out << " #{x}='#{z}'"
1562
+ else
1563
+ out << " #{x}='#{y}'"
1564
+ end
1565
+ end
1566
+ end
1567
+ out << ">\n"
1568
+ end
1569
+ return out
1570
+ end
1571
+ def end_b
1572
+ out = ''
1573
+ out << "</b>\n"
1574
+ return out
1575
+ end
1576
+ def bdo(dir, content, options = {})
1577
+ out = ''
1578
+ opts = ['class', 'id', 'title']
1579
+ if options.nil?
1580
+ out << "<bdo dir='#{dir}'>#{content}</bdo>\n"
1581
+ else
1582
+ out << "<bdo dir='#{dir}'"
1583
+ options.each do |x,y|
1584
+ x = x.to_s
1585
+ if opts.include?("#{x}")
1586
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1587
+ z = y.join(' ')
1588
+ out << " #{x}='#{z}'"
1589
+ else
1590
+ out << " #{x}='#{y}'"
1591
+ end
1592
+ end
1593
+ end
1594
+ out << ">#{content}</bdo>\n"
1595
+ end
1596
+ return out
1597
+ end
1598
+ def start_bdo(dir, options = {})
1599
+ out = ''
1600
+ opts = ['class', 'id', 'title']
1601
+ if options.nil?
1602
+ out << "<bdo>\n"
1603
+ else
1604
+ out << "<bdo"
1605
+ options.each do |x,y|
1606
+ x = x.to_s
1607
+ if opts.include?("#{x}")
1608
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1609
+ z = y.join(' ')
1610
+ out << " #{x}='#{z}'"
1611
+ else
1612
+ out << " #{x}='#{y}'"
1613
+ end
1614
+ end
1615
+ end
1616
+ out << ">\n"
1617
+ end
1618
+ return out
1619
+ end
1620
+ def end_bdo
1621
+ out = ''
1622
+ out << "</bdo>\n"
1623
+ return out
1624
+ end
1625
+ def big(content, options = {})
1626
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1627
+ out << " that you use CSS instead of the big element -->\n"
1628
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1629
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1630
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1631
+ 'style']
1632
+ if options.nil?
1633
+ out << "<big>#{content}</big>\n"
1634
+ else
1635
+ out << "<big"
1636
+ options.each do |x,y|
1637
+ x = x.to_s
1638
+ if opts.include?("#{x}")
1639
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1640
+ z = y.join(' ')
1641
+ out << " #{x}='#{z}'"
1642
+ else
1643
+ out << " #{x}='#{y}'"
1644
+ end
1645
+ end
1646
+ end
1647
+ out << ">#{content}</big>\n"
1648
+ end
1649
+ return out
1650
+ end
1651
+ def start_big(options = {})
1652
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1653
+ out << " that you use CSS instead of the big element -->\n"
1654
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1655
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1656
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1657
+ 'style']
1658
+ if options.nil?
1659
+ out << "<big>\n"
1660
+ else
1661
+ out << "<big"
1662
+ options.each do |x,y|
1663
+ x = x.to_s
1664
+ if opts.include?("#{x}")
1665
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1666
+ z = y.join(' ')
1667
+ out << " #{x}='#{z}'"
1668
+ else
1669
+ out << " #{x}='#{y}'"
1670
+ end
1671
+ end
1672
+ end
1673
+ out << ">\n"
1674
+ end
1675
+ return out
1676
+ end
1677
+ def end_big
1678
+ out = ''
1679
+ out << "</big>\n"
1680
+ return out
1681
+ end
1682
+ def i(content, options = {})
1683
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1684
+ out << " that you use CSS instead of the i element -->\n"
1685
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1686
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1687
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1688
+ 'style']
1689
+ if options.nil?
1690
+ out << "<i>#{content}</i>\n"
1691
+ else
1692
+ out << "<i"
1693
+ options.each do |x,y|
1694
+ x = x.to_s
1695
+ if opts.include?("#{x}")
1696
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1697
+ z = y.join(' ')
1698
+ out << " #{x}='#{z}'"
1699
+ else
1700
+ out << " #{x}='#{y}'"
1701
+ end
1702
+ end
1703
+ end
1704
+ out << ">#{content}</i>\n"
1705
+ end
1706
+ return out
1707
+ end
1708
+ def start_i(options = {})
1709
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
1710
+ out << " that you use CSS instead of the i element -->\n"
1711
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick',
1712
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1713
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1714
+ 'style']
1715
+ if options.nil?
1716
+ out << "<i>\n"
1717
+ else
1718
+ out << "<i"
1719
+ options.each do |x,y|
1720
+ x = x.to_s
1721
+ if opts.include?("#{x}")
1722
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1723
+ z = y.join(' ')
1724
+ out << " #{x}='#{z}'"
1725
+ else
1726
+ out << " #{x}='#{y}'"
1727
+ end
1728
+ end
1729
+ end
1730
+ out << ">\n"
1731
+ end
1732
+ return out
1733
+ end
1734
+ def end_i
1735
+ out = ''
1736
+ out << "</i>\n"
1737
+ return out
1738
+ end
1739
+ def blockquote(content, options = {})
1740
+ out = ''
1741
+ opts = ['cite', 'class', 'id', 'title', 'onclick', 'ondblclick',
1742
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1743
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1744
+ 'style']
1745
+ if options.nil?
1746
+ out << "<blockquote>#{content}</blockquote>\n"
1747
+ else
1748
+ out << "<blockquote"
1749
+ options.each do |x,y|
1750
+ x = x.to_s
1751
+ if opts.include?("#{x}")
1752
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1753
+ z = y.join(' ')
1754
+ out << " #{x}='#{z}'"
1755
+ else
1756
+ out << " #{x}='#{y}'"
1757
+ end
1758
+ end
1759
+ end
1760
+ out << ">#{content}</blockquote>\n"
1761
+ end
1762
+ return out
1763
+ end
1764
+ def start_blockquote(options = {})
1765
+ out = ''
1766
+ opts = ['cite', 'class', 'id', 'title', 'onclick', 'ondblclick',
1767
+ 'onkeyup', 'onkeydown', 'onkeypress', 'onmousedown',
1768
+ 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout',
1769
+ 'style']
1770
+ if options.nil?
1771
+ out << "<blockquote>\n"
1772
+ else
1773
+ out << "<blockquote"
1774
+ options.each do |x,y|
1775
+ x = x.to_s
1776
+ if opts.include?("#{x}")
1777
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1778
+ z = y.join(' ')
1779
+ out << " #{x}='#{z}'"
1780
+ else
1781
+ out << " #{x}='#{y}'"
1782
+ end
1783
+ end
1784
+ end
1785
+ out << ">\n"
1786
+ end
1787
+ return out
1788
+ end
1789
+ def end_blockquote
1790
+ out = ''
1791
+ out << "</blockquote>\n"
1792
+ return out
1793
+ end
1794
+ def br(num, options = {})
1795
+ out = ''
1796
+ opts = ['class', 'id', 'title', 'style']
1797
+ num.to_i.times do
1798
+ if options.nil?
1799
+ out << "<br />\n"
1800
+ else
1801
+ out << "<br"
1802
+ options.each do |x,y|
1803
+ x = x.to_s
1804
+ if opts.include?("#{x}")
1805
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1806
+ z = y.join(' ')
1807
+ out << " #{x}='#{z}'"
1808
+ else
1809
+ out << " #{x}='#{y}'"
1810
+ end
1811
+ end
1812
+ end
1813
+ out << " />"
1814
+ end
1815
+ end
1816
+ end
1817
+ def button(content, optiosn = {})
1818
+ out = ''
1819
+ opts = ['name', 'type', 'value', 'accessley', 'disabled', 'onblur',
1820
+ 'onfocus', 'tabindex', 'class', 'id', 'title', 'onclick',
1821
+ 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
1822
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
1823
+ 'onmouseout', 'style']
1824
+ if options.nil?
1825
+ out << "<button>#{content}</button>\n"
1826
+ else
1827
+ out << "<button"
1828
+ options.each do |x,y|
1829
+ x = x.to_s
1830
+ if opts.include?("#{x}")
1831
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1832
+ z = y.join(' ')
1833
+ out << " #{x}='#{z}'"
1834
+ else
1835
+ out << " #{x}='#{y}'"
1836
+ end
1837
+ end
1838
+ end
1839
+ out << ">#{content}</button>\n"
1840
+ end
1841
+ return out
1842
+ end
1843
+ def start_button(options = {})
1844
+ out = ''
1845
+ opts = ['name', 'type', 'value', 'accessley', 'disabled', 'onblur',
1846
+ 'onfocus', 'tabindex', 'class', 'id', 'title', 'onclick',
1847
+ 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
1848
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
1849
+ 'onmouseout', 'style']
1850
+ if options.nil?
1851
+ out << "<button>\n"
1852
+ else
1853
+ out << "<button"
1854
+ options.each do |x,y|
1855
+ x = x.to_s
1856
+ if opts.include?("#{x}")
1857
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1858
+ z = y.join(' ')
1859
+ out << " #{x}='#{z}'"
1860
+ else
1861
+ out << " #{x}='#{y}'"
1862
+ end
1863
+ end
1864
+ end
1865
+ out << ">\n"
1866
+ end
1867
+ return out
1868
+ end
1869
+ def end_button
1870
+ out = ''
1871
+ out << "</button>\n"
1872
+ return out
1873
+ end
1874
+ def cite(content, options = {})
1875
+ out = ''
1876
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
1877
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
1878
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
1879
+ if options.nil?
1880
+ out << "<cite>#{content}</cite>\n"
1881
+ else
1882
+ out << "<cite"
1883
+ options.each do |x,y|
1884
+ x = x.to_s
1885
+ if opts.include?("#{x}")
1886
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1887
+ z = y.join(' ')
1888
+ out << " #{x}='#{z}'"
1889
+ else
1890
+ out << " #{x}='#{y}'"
1891
+ end
1892
+ end
1893
+ end
1894
+ out << ">#{content}</cite>\n"
1895
+ end
1896
+ return out
1897
+ end
1898
+ def start_cite(options = {})
1899
+ out = ''
1900
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
1901
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
1902
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
1903
+ if options.nil?
1904
+ out << "<cite>\n"
1905
+ else
1906
+ out << "<cite"
1907
+ options.each do |x,y|
1908
+ x = x.to_s
1909
+ if opts.include?("#{x}")
1910
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1911
+ z = y.join(' ')
1912
+ out << " #{x}='#{z}'"
1913
+ else
1914
+ out << " #{x}='#{y}'"
1915
+ end
1916
+ end
1917
+ end
1918
+ out << ">\n"
1919
+ end
1920
+ return out
1921
+ end
1922
+ def end_cite
1923
+ out = ''
1924
+ out << "</cite>\n"
1925
+ return out
1926
+ end
1927
+ def code(content, options = {})
1928
+ out = ''
1929
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
1930
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
1931
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
1932
+ if options.nil?
1933
+ out << "<code>#{content}</code>\n"
1934
+ else
1935
+ out << "<code"
1936
+ options.each do |x,y|
1937
+ x = x.to_s
1938
+ if opts.include?("#{x}")
1939
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1940
+ z = y.join(' ')
1941
+ out << " #{x}='#{z}'"
1942
+ else
1943
+ out << " #{x}='#{y}'"
1944
+ end
1945
+ end
1946
+ end
1947
+ out << ">#{content}</code>\n"
1948
+ end
1949
+ return out
1950
+ end
1951
+ def start_code(options = {})
1952
+ out = ''
1953
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
1954
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
1955
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
1956
+ if options.nil?
1957
+ out << "<code>\n"
1958
+ else
1959
+ out << "<code"
1960
+ options.each do |x,y|
1961
+ x = x.to_s
1962
+ if opts.include?("#{x}")
1963
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1964
+ z = y.join(' ')
1965
+ out << " #{x}='#{z}'"
1966
+ else
1967
+ out << " #{x}='#{y}'"
1968
+ end
1969
+ end
1970
+ end
1971
+ out << ">\n"
1972
+ end
1973
+ return out
1974
+ end
1975
+ def end_code
1976
+ out = ''
1977
+ out << "</code>\n"
1978
+ return out
1979
+ end
1980
+ def dl(content, options = {})
1981
+ out = ''
1982
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
1983
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
1984
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
1985
+ if options.nil?
1986
+ out << "<dl>#{content}</dl>\n"
1987
+ else
1988
+ out << "<dl"
1989
+ options.each do |x,y|
1990
+ x = x.to_s
1991
+ if opts.include?("#{x}")
1992
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
1993
+ z = y.join(' ')
1994
+ out << " #{x}='#{z}'"
1995
+ else
1996
+ out << " #{x}='#{y}'"
1997
+ end
1998
+ end
1999
+ end
2000
+ out << ">#{content}</dl>\n"
2001
+ end
2002
+ return out
2003
+ end
2004
+ def start_dl(options = {})
2005
+ out = ''
2006
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2007
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2008
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2009
+ if options.nil?
2010
+ out << "<dl>\n"
2011
+ else
2012
+ out << "<dl"
2013
+ options.each do |x,y|
2014
+ x = x.to_s
2015
+ if opts.include?("#{x}")
2016
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2017
+ z = y.join(' ')
2018
+ out << " #{x}='#{z}'"
2019
+ else
2020
+ out << " #{x}='#{y}'"
2021
+ end
2022
+ end
2023
+ end
2024
+ out << ">\n"
2025
+ end
2026
+ return out
2027
+ end
2028
+ def end_dl
2029
+ out = ''
2030
+ out << "</dl>\n"
2031
+ return out
2032
+ end
2033
+ def dd(content, options = {})
2034
+ out = ''
2035
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2036
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2037
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2038
+ if options.nil?
2039
+ out << "<dd>#{content}</dd>\n"
2040
+ else
2041
+ out << "<dd"
2042
+ options.each do |x,y|
2043
+ x = x.to_s
2044
+ if opts.include?("#{x}")
2045
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2046
+ z = y.join(' ')
2047
+ out << " #{x}='#{z}'"
2048
+ else
2049
+ out << " #{x}='#{y}'"
2050
+ end
2051
+ end
2052
+ end
2053
+ out << ">#{content}</dd>\n"
2054
+ end
2055
+ return out
2056
+ end
2057
+ def start_dd(options = {})
2058
+ out = ''
2059
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2060
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2061
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2062
+ if options.nil?
2063
+ out << "<dd>\n"
2064
+ else
2065
+ out << "<dd"
2066
+ options.each do |x,y|
2067
+ x = x.to_s
2068
+ if opts.include?("#{x}")
2069
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2070
+ z = y.join(' ')
2071
+ out << " #{x}='#{z}'"
2072
+ else
2073
+ out << " #{x}='#{y}'"
2074
+ end
2075
+ end
2076
+ end
2077
+ out << ">\n"
2078
+ end
2079
+ return out
2080
+ end
2081
+ def end_dd
2082
+ out = ''
2083
+ out << "</dd>\n"
2084
+ return out
2085
+ end
2086
+ def dt(content, options = {})
2087
+ out = ''
2088
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2089
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2090
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2091
+ if options.nil?
2092
+ out << "<dt>#{content}</dt>\n"
2093
+ else
2094
+ out << "<dt"
2095
+ options.each do |x,y|
2096
+ x = x.to_s
2097
+ if opts.include?("#{x}")
2098
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2099
+ z = y.join(' ')
2100
+ out << " #{x}='#{z}'"
2101
+ else
2102
+ out << " #{x}='#{y}'"
2103
+ end
2104
+ end
2105
+ end
2106
+ out << ">#{content}</dt>\n"
2107
+ end
2108
+ return out
2109
+ end
2110
+ def start_dt(options = {})
2111
+ out = ''
2112
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2113
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2114
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2115
+ if options.nil?
2116
+ out << "<dt>\n"
2117
+ else
2118
+ out << "<dt"
2119
+ options.each do |x,y|
2120
+ x = x.to_s
2121
+ if opts.include?("#{x}")
2122
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2123
+ z = y.join(' ')
2124
+ out << " #{x}='#{z}'"
2125
+ else
2126
+ out << " #{x}='#{y}'"
2127
+ end
2128
+ end
2129
+ end
2130
+ out << ">\n"
2131
+ end
2132
+ return out
2133
+ end
2134
+ def end_dt
2135
+ out = ''
2136
+ out << "</dt>\n"
2137
+ return out
2138
+ end
2139
+ def del(content, options = {})
2140
+ out = ''
2141
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2142
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2143
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style', 'cite',
2144
+ 'datetime']
2145
+ if options.nil?
2146
+ out << "<del>#{content}</del>\n"
2147
+ else
2148
+ out << "<del"
2149
+ options.each do |x,y|
2150
+ x = x.to_s
2151
+ if opts.include?("#{x}")
2152
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2153
+ z = y.join(' ')
2154
+ out << " #{x}='#{z}'"
2155
+ else
2156
+ out << " #{x}='#{y}'"
2157
+ end
2158
+ end
2159
+ end
2160
+ out << ">#{content}</del>\n"
2161
+ end
2162
+ return out
2163
+ end
2164
+ def start_del(options = {})
2165
+ out = ''
2166
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2167
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2168
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style', 'cite',
2169
+ 'datetime']
2170
+ if options.nil?
2171
+ out << "<del>\n"
2172
+ else
2173
+ out << "<del"
2174
+ options.each do |x,y|
2175
+ x = x.to_s
2176
+ if opts.include?("#{x}")
2177
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2178
+ z = y.join(' ')
2179
+ out << " #{x}='#{z}'"
2180
+ else
2181
+ out << " #{x}='#{y}'"
2182
+ end
2183
+ end
2184
+ end
2185
+ out << ">\n"
2186
+ end
2187
+ return out
2188
+ end
2189
+ def end_del
2190
+ out = ''
2191
+ out << "</del>\n"
2192
+ return out
2193
+ end
2194
+ def dfn(content, options = {})
2195
+ out = ''
2196
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2197
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2198
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2199
+ if options.nil?
2200
+ out << "<dfn>#{content}</dfn>\n"
2201
+ else
2202
+ out << "<dfn"
2203
+ options.each do |x,y|
2204
+ x = x.to_s
2205
+ if opts.include?("#{x}")
2206
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2207
+ z = y.join(' ')
2208
+ out << " #{x}='#{z}'"
2209
+ else
2210
+ out << " #{x}='#{y}'"
2211
+ end
2212
+ end
2213
+ end
2214
+ out << ">#{content}</dfn>\n"
2215
+ end
2216
+ return out
2217
+ end
2218
+ def start_dfn(options = {})
2219
+ out = ''
2220
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2221
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2222
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2223
+ if options.nil?
2224
+ out << "<dfn>\n"
2225
+ else
2226
+ out << "<dfn"
2227
+ options.each do |x,y|
2228
+ x = x.to_s
2229
+ if opts.include?("#{x}")
2230
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2231
+ z = y.join(' ')
2232
+ out << " #{x}='#{z}'"
2233
+ else
2234
+ out << " #{x}='#{y}'"
2235
+ end
2236
+ end
2237
+ end
2238
+ out << ">\n"
2239
+ end
2240
+ return out
2241
+ end
2242
+ def end_dfn
2243
+ out = ''
2244
+ out << "</dfn>\n"
2245
+ return out
2246
+ end
2247
+ def em(content, options = {})
2248
+ out = ''
2249
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2250
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2251
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2252
+ if options.nil?
2253
+ out << "<em>#{content}</em>\n"
2254
+ else
2255
+ out << "<em"
2256
+ options.each do |x,y|
2257
+ x = x.to_s
2258
+ if opts.include?("#{x}")
2259
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2260
+ z = y.join(' ')
2261
+ out << " #{x}='#{z}'"
2262
+ else
2263
+ out << " #{x}='#{y}'"
2264
+ end
2265
+ end
2266
+ end
2267
+ out << ">#{content}</em>\n"
2268
+ end
2269
+ return out
2270
+ end
2271
+ def start_em(options = {})
2272
+ out = ''
2273
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2274
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2275
+ 'onmouseover', 'onmousemove', 'onmouseout', 'style']
2276
+ if options.nil?
2277
+ out << "<em>\n"
2278
+ else
2279
+ out << "<em"
2280
+ options.each do |x,y|
2281
+ x = x.to_s
2282
+ if opts.include?("#{x}")
2283
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2284
+ z = y.join(' ')
2285
+ out << " #{x}='#{z}'"
2286
+ else
2287
+ out << " #{x}='#{y}'"
2288
+ end
2289
+ end
2290
+ end
2291
+ out << ">\n"
2292
+ end
2293
+ return out
2294
+ end
2295
+ def end_em
2296
+ out = ''
2297
+ out << "</em>\n"
2298
+ return out
2299
+ end
2300
+ def fieldset(content, options = {})
2301
+ out = ''
2302
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2303
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2304
+ 'onmouseover', 'onmousfieldsetove', 'onmouseout', 'style']
2305
+ if options.nil?
2306
+ out << "<fieldset>#{content}</fieldset>\n"
2307
+ else
2308
+ out << "<fieldset"
2309
+ options.each do |x,y|
2310
+ x = x.to_s
2311
+ if opts.include?("#{x}")
2312
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2313
+ z = y.join(' ')
2314
+ out << " #{x}='#{z}'"
2315
+ else
2316
+ out << " #{x}='#{y}'"
2317
+ end
2318
+ end
2319
+ end
2320
+ out << ">#{content}</fieldset>\n"
2321
+ end
2322
+ return out
2323
+ end
2324
+ def start_fieldset(options = {})
2325
+ out = ''
2326
+ opts = ['class', 'id', 'title', 'onclick', 'ondblclick', 'onkeyup',
2327
+ 'onkeydown', 'onkeypress', 'onmousedown', 'onmouseup',
2328
+ 'onmouseover', 'onmousfieldsetove', 'onmouseout', 'style']
2329
+ if options.nil?
2330
+ out << "<fieldset>\n"
2331
+ else
2332
+ out << "<fieldset"
2333
+ options.each do |x,y|
2334
+ x = x.to_s
2335
+ if opts.include?("#{x}")
2336
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2337
+ z = y.join(' ')
2338
+ out << " #{x}='#{z}'"
2339
+ else
2340
+ out << " #{x}='#{y}'"
2341
+ end
2342
+ end
2343
+ end
2344
+ out << ">\n"
2345
+ end
2346
+ return out
2347
+ end
2348
+ def end_fieldset
2349
+ out = ''
2350
+ out << "</fieldset>\n"
2351
+ return out
2352
+ end
2353
+ def form(action, method, content, options = {})
2354
+ out = ''
2355
+ opts = ['onmouseout', 'accept', 'accept-charsets', 'enctype',
2356
+ 'onreset', 'onsumit', 'class', 'id', 'title', 'style',
2357
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2358
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2359
+ if options.nil?
2360
+ out << "<form action='#{action}' method='#{method}'>#{content}</form>\n"
2361
+ else
2362
+ out << "<form action='#{action}' method='#{method}'"
2363
+ options.each do |x,y|
2364
+ x = x.to_s
2365
+ if opts.include?("#{x}")
2366
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2367
+ z = y.join(' ')
2368
+ out << " #{x}='#{z}'"
2369
+ else
2370
+ out << " #{x}='#{y}'"
2371
+ end
2372
+ end
2373
+ end
2374
+ out << ">#{content}</form>\n"
2375
+ end
2376
+ return out
2377
+ end
2378
+ def start_form(action, method, options = {})
2379
+ out = ''
2380
+ opts = ['onmouseout', 'accept', 'accept-charsets', 'enctype',
2381
+ 'onreset', 'onsumit', 'class', 'id', 'title', 'style',
2382
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2383
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2384
+ if options.nil?
2385
+ out << "<form action='#{action}' method='#{method}'>\n"
2386
+ else
2387
+ out << "<form action='#{action}' method='#{method}'"
2388
+ options.each do |x,y|
2389
+ x = x.to_s
2390
+ if opts.include?("#{x}")
2391
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2392
+ z = y.join(' ')
2393
+ out << " #{x}='#{z}'"
2394
+ else
2395
+ out << " #{x}='#{y}'"
2396
+ end
2397
+ end
2398
+ end
2399
+ out << ">\n"
2400
+ end
2401
+ return out
2402
+ end
2403
+ def end_form
2404
+ out = ''
2405
+ out << "</form>\n"
2406
+ return out
2407
+ end
2408
+ def input(type, options = {})
2409
+ out = ''
2410
+ opts = ['alt', 'checked', 'maxlength', 'name', 'size', 'value',
2411
+ 'accept', 'accesskey', 'disabled', 'ismap', 'onblur',
2412
+ 'onchange', 'onfocus', 'onselect', 'readonly', 'src',
2413
+ 'tabindex', 'usemap', 'class', 'id', 'title', 'style',
2414
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2415
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2416
+ if options.nil?
2417
+ out << "<input type='#{type}' />\n"
2418
+ else
2419
+ out << "<input type='#{type}'"
2420
+ options.each do |x,y|
2421
+ x = x.to_s
2422
+ if opts.include?("#{x}")
2423
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2424
+ z = y.join(' ')
2425
+ out << " #{x}='#{z}'"
2426
+ else
2427
+ out << " #{x}='#{y}'"
2428
+ end
2429
+ end
2430
+ end
2431
+ out << " />\n"
2432
+ end
2433
+ return out
2434
+ end
2435
+ def ins(content, options = {})
2436
+ out = ''
2437
+ opts = ['cite', 'datetime', 'class', 'id', 'title', 'style',
2438
+ 'onchange', 'onfocus', 'onselect', 'readonly', 'src',
2439
+ 'tabindex', 'usemap', 'class', 'id', 'title', 'style',
2440
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2441
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2442
+ if options.nil?
2443
+ out << "<ins>#{content}</ins>\n"
2444
+ else
2445
+ out << "<ins"
2446
+ options.each do |x,y|
2447
+ x = x.to_s
2448
+ if opts.include?("#{x}")
2449
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2450
+ z = y.join(' ')
2451
+ out << " #{x}='#{z}'"
2452
+ else
2453
+ out << " #{x}='#{y}'"
2454
+ end
2455
+ end
2456
+ end
2457
+ out << ">#{content}</ins>\n"
2458
+ end
2459
+ return out
2460
+ end
2461
+ def start_ins(options = {})
2462
+ out = ''
2463
+ opts = ['cite', 'datetime', 'class', 'id', 'title', 'style',
2464
+ 'onchange', 'onfocus', 'onselect', 'readonly', 'src',
2465
+ 'tabindex', 'usemap', 'class', 'id', 'title', 'style',
2466
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2467
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2468
+ if options.nil?
2469
+ out << "<ins>\n"
2470
+ else
2471
+ out << "<ins"
2472
+ options.each do |x,y|
2473
+ x = x.to_s
2474
+ if opts.include?("#{x}")
2475
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2476
+ z = y.join(' ')
2477
+ out << " #{x}='#{z}'"
2478
+ else
2479
+ out << " #{x}='#{y}'"
2480
+ end
2481
+ end
2482
+ end
2483
+ out << ">\n"
2484
+ end
2485
+ return out
2486
+ end
2487
+ def end_ins
2488
+ out = ''
2489
+ out << "</ins>\n"
2490
+ return out
2491
+ end
2492
+ def kbd(content, options = {})
2493
+ out = ''
2494
+ opts = ['class', 'id', 'title', 'style',
2495
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2496
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2497
+ if options.nil?
2498
+ out << "<kbd>#{content}</kbd>\n"
2499
+ else
2500
+ out << "<kbd"
2501
+ options.each do |x,y|
2502
+ x = x.to_s
2503
+ if opts.include?("#{x}")
2504
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2505
+ z = y.join(' ')
2506
+ out << " #{x}='#{z}'"
2507
+ else
2508
+ out << " #{x}='#{y}'"
2509
+ end
2510
+ end
2511
+ end
2512
+ out << ">#{content}</kbd>\n"
2513
+ end
2514
+ return out
2515
+ end
2516
+ def start_kbd(options = {})
2517
+ out = ''
2518
+ opts = ['class', 'id', 'title', 'style',
2519
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2520
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove']
2521
+ if options.nil?
2522
+ out << "<kbd>\n"
2523
+ else
2524
+ out << "<kbd"
2525
+ options.each do |x,y|
2526
+ x = x.to_s
2527
+ if opts.include?("#{x}")
2528
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2529
+ z = y.join(' ')
2530
+ out << " #{x}='#{z}'"
2531
+ else
2532
+ out << " #{x}='#{y}'"
2533
+ end
2534
+ end
2535
+ end
2536
+ out << ">\n"
2537
+ end
2538
+ return out
2539
+ end
2540
+ def end_kbd
2541
+ out = ''
2542
+ out << "</kbd>\n"
2543
+ return out
2544
+ end
2545
+ def label(content, options = {})
2546
+ out = ''
2547
+ opts = ['for', 'accesskey', 'onblur', 'onfocus', 'class', 'id', 'title',
2548
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2549
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove',
2550
+ 'style']
2551
+ if options.nil?
2552
+ out << "<label>#{content}</label>\n"
2553
+ else
2554
+ out << "<label"
2555
+ options.each do |x,y|
2556
+ x = x.to_s
2557
+ if opts.include?("#{x}")
2558
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2559
+ z = y.join(' ')
2560
+ out << " #{x}='#{z}'"
2561
+ else
2562
+ out << " #{x}='#{y}'"
2563
+ end
2564
+ end
2565
+ end
2566
+ out << ">#{content}</label>\n"
2567
+ end
2568
+ return out
2569
+ end
2570
+ def start_label(options = {})
2571
+ out = ''
2572
+ opts = ['for', 'accesskey', 'onblur', 'onfocus', 'class', 'id', 'title',
2573
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2574
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove',
2575
+ 'style']
2576
+ if options.nil?
2577
+ out << "<label>\n"
2578
+ else
2579
+ out << "<label"
2580
+ options.each do |x,y|
2581
+ x = x.to_s
2582
+ if opts.include?("#{x}")
2583
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2584
+ z = y.join(' ')
2585
+ out << " #{x}='#{z}'"
2586
+ else
2587
+ out << " #{x}='#{y}'"
2588
+ end
2589
+ end
2590
+ end
2591
+ out << ">\n"
2592
+ end
2593
+ return out
2594
+ end
2595
+ def end_label
2596
+ out = ''
2597
+ out << "</label>\n"
2598
+ return out
2599
+ end
2600
+ def legend(content, options = {})
2601
+ out = ''
2602
+ opts = ['accesskey', 'onblur', 'onfocus', 'class', 'id', 'title',
2603
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2604
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove',
2605
+ 'style']
2606
+ if options.nil?
2607
+ out << "<lengend>#{content}</legend>\n"
2608
+ else
2609
+ out << "<legend"
2610
+ options.each do |x,y|
2611
+ x = x.to_s
2612
+ if opts.include?("#{x}")
2613
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2614
+ z = y.join(' ')
2615
+ out << " #{x}='#{z}'"
2616
+ else
2617
+ out << " #{x}='#{y}'"
2618
+ end
2619
+ end
2620
+ end
2621
+ out << ">#{content}</legend>\n"
2622
+ end
2623
+ return out
2624
+ end
2625
+ def start_legend(options = {})
2626
+ out = ''
2627
+ opts = ['accesskey', 'onblur', 'onfocus', 'class', 'id', 'title',
2628
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2629
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousfieldsetove',
2630
+ 'style']
2631
+ if options.nil?
2632
+ out << "<lengend>\n"
2633
+ else
2634
+ out << "<legend"
2635
+ options.each do |x,y|
2636
+ x = x.to_s
2637
+ if opts.include?("#{x}")
2638
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2639
+ z = y.join(' ')
2640
+ out << " #{x}='#{z}'"
2641
+ else
2642
+ out << " #{x}='#{y}'"
2643
+ end
2644
+ end
2645
+ end
2646
+ out << ">\n"
2647
+ end
2648
+ return out
2649
+ end
2650
+ def end_legend
2651
+ out = ''
2652
+ out << "</legend>\n"
2653
+ return out
2654
+ end
2655
+ def Map(content, options = {})
2656
+ out = ''
2657
+ opts = ['class', 'id', 'title', 'style', 'onmouseover',
2658
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2659
+ 'onmousedown', 'onmouseup', 'onmousfieldsetove']
2660
+ if options.nil?
2661
+ out << "<map>#{content}</map>\n"
2662
+ else
2663
+ out << "<map"
2664
+ options.each do |x,y|
2665
+ x = x.to_s
2666
+ if opts.include?("#{x}")
2667
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2668
+ z = y.join(' ')
2669
+ out << " #{x}='#{z}'"
2670
+ else
2671
+ out << " #{x}='#{y}'"
2672
+ end
2673
+ end
2674
+ end
2675
+ out << ">#{content}</map>\n"
2676
+ end
2677
+ return out
2678
+ end
2679
+ def start_map(options = {})
2680
+ out = ''
2681
+ opts = ['class', 'id', 'title', 'style', 'onmouseover',
2682
+ 'onclick', 'ondblclick', 'onkeyup', 'onkeydown', 'onkeypress',
2683
+ 'onmousedown', 'onmouseup', 'onmousfieldsetove']
2684
+ if options.nil?
2685
+ out << "<map>\n"
2686
+ else
2687
+ out << "<map"
2688
+ options.each do |x,y|
2689
+ x = x.to_s
2690
+ if opts.include?("#{x}")
2691
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2692
+ z = y.join(' ')
2693
+ out << " #{x}='#{z}'"
2694
+ else
2695
+ out << " #{x}='#{y}'"
2696
+ end
2697
+ end
2698
+ end
2699
+ out << ">\n"
2700
+ end
2701
+ return out
2702
+ end
2703
+ def end_map
2704
+ out = ''
2705
+ out << "</map>\n"
2706
+ return out
2707
+ end
2708
+ def script(content, options = {})
2709
+ out = ''
2710
+ opts = ['class', 'id', 'title', 'style', 'src', 'type', 'charset',
2711
+ 'defer', 'style', 'onmousedown', 'onmouseup', 'onmouseover',
2712
+ 'onmousfieldsetove', 'onclick', 'ondblclick', 'onkeyup',
2713
+ 'onkeydown', 'onkeypress']
2714
+ if options.nil?
2715
+ out << "<script>\n //<![CDATA[\n#{content}\n //]]>\n</script>\n"
2716
+ else
2717
+ out << "<script"
2718
+ options.each do |x,y|
2719
+ x = x.to_s
2720
+ if opts.include?("#{x}")
2721
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2722
+ z = y.join(' ')
2723
+ out << " #{x}='#{z}'"
2724
+ else
2725
+ out << " #{x}='#{y}'"
2726
+ end
2727
+ end
2728
+ end
2729
+ out << ">\n"
2730
+ out << " //<![CDATA[\n#{content}\n //]]>\n</script>\n"
2731
+ end
2732
+ return out
2733
+ end
2734
+ def start_script(options = {})
2735
+ out = ''
2736
+ opts = ['class', 'id', 'title', 'style', 'src', 'type', 'charset',
2737
+ 'defer', 'style', 'onmousedown', 'onmouseup', 'onmouseover',
2738
+ 'onmousfieldsetove', 'onclick', 'ondblclick', 'onkeyup',
2739
+ 'onkeydown', 'onkeypress']
2740
+ if options.nil?
2741
+ out << "<script>\n"
2742
+ else
2743
+ out << "<script"
2744
+ options.each do |x,y|
2745
+ x = x.to_s
2746
+ if opts.include?("#{x}")
2747
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2748
+ z = y.join(' ')
2749
+ out << " #{x}='#{z}'"
2750
+ else
2751
+ out << " #{x}='#{y}'"
2752
+ end
2753
+ end
2754
+ end
2755
+ out << ">\n"
2756
+ out << " //<![CDATA[\n"
2757
+ end
2758
+ return out
2759
+ end
2760
+ def end_script
2761
+ out = ''
2762
+ out << " //]]>\n"
2763
+ out << "</script>\n"
2764
+ return out
2765
+ end
2766
+ def noscript(content, options = {})
2767
+ out = ''
2768
+ opts = ['class', 'id', 'title', 'style', 'onmousedown', 'onmouseup',
2769
+ 'onmouseover', 'onmousfieldsetove', 'onclick', 'ondblclick',
2770
+ 'onkeyup', 'onkeydown', 'onkeypress']
2771
+ if options.nil?
2772
+ out << "<noscript>#{content}</noscript>\n"
2773
+ else
2774
+ out << "<noscript"
2775
+ options.each do |x,y|
2776
+ x = x.to_s
2777
+ if opts.include?("#{x}")
2778
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2779
+ z = y.join(' ')
2780
+ out << " #{x}='#{z}'"
2781
+ else
2782
+ out << " #{x}='#{y}'"
2783
+ end
2784
+ end
2785
+ end
2786
+ out << ">#{content}</noscript>\n"
2787
+ end
2788
+ return out
2789
+ end
2790
+ def start_noscript(options = {})
2791
+ out = ''
2792
+ opts = ['class', 'id', 'title', 'style', 'onmousedown', 'onmouseup',
2793
+ 'onmouseover', 'onmousfieldsetove', 'onclick', 'ondblclick',
2794
+ 'onkeyup', 'onkeydown', 'onkeypress']
2795
+ if options.nil?
2796
+ out << "<noscript>\n"
2797
+ else
2798
+ out << "<noscript"
2799
+ options.each do |x,y|
2800
+ x = x.to_s
2801
+ if opts.include?("#{x}")
2802
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2803
+ z = y.join(' ')
2804
+ out << " #{x}='#{z}'"
2805
+ else
2806
+ out << " #{x}='#{y}'"
2807
+ end
2808
+ end
2809
+ end
2810
+ out << ">\n"
2811
+ end
2812
+ return out
2813
+ end
2814
+ def end_noscript
2815
+ out = ''
2816
+ out << "</noscript>\n"
2817
+ return out
2818
+ end
2819
+ def object(content, options = {})
2820
+ out = ''
2821
+ opts = ['classid', 'codebase', 'heiht', 'name', 'type', 'width',
2822
+ 'archive', 'codetype', 'data', 'declare', 'standby', 'tabindex',
2823
+ 'usemap', 'class', 'id', 'title', 'onclick', 'ondblclick',
2824
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2825
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup', 'style']
2826
+ if options.nil?
2827
+ out << "<object>#{content}</object>\n"
2828
+ else
2829
+ out << "<object"
2830
+ options.each do |x,y|
2831
+ x = x.to_s
2832
+ if opts.include?("#{x}")
2833
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2834
+ z = y.join(' ')
2835
+ out << " #{x}='#{z}'"
2836
+ else
2837
+ out << " #{x}='#{y}'"
2838
+ end
2839
+ end
2840
+ end
2841
+ out << ">#{content}</object>\n"
2842
+ end
2843
+ return out
2844
+ end
2845
+ def start_object(options = {})
2846
+ out = ''
2847
+ opts = ['classid', 'codebase', 'heiht', 'name', 'type', 'width',
2848
+ 'archive', 'codetype', 'data', 'declare', 'standby', 'tabindex',
2849
+ 'usemap', 'class', 'id', 'title', 'onclick', 'ondblclick',
2850
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2851
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup', 'style']
2852
+ if options.nil?
2853
+ out << "<object>\n"
2854
+ else
2855
+ out << "<object"
2856
+ options.each do |x,y|
2857
+ x = x.to_s
2858
+ if opts.include?("#{x}")
2859
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2860
+ z = y.join(' ')
2861
+ out << " #{x}='#{z}'"
2862
+ else
2863
+ out << " #{x}='#{y}'"
2864
+ end
2865
+ end
2866
+ end
2867
+ out << ">\n"
2868
+ end
2869
+ return out
2870
+ end
2871
+ def end_object
2872
+ out = ''
2873
+ out << "</object>\n"
2874
+ return out
2875
+ end
2876
+ def optgroup(content, options = {})
2877
+ out = ''
2878
+ opts = ['label', 'class', 'id', 'title', 'style', 'onclick', 'ondblclick',
2879
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2880
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
2881
+ if options.nil?
2882
+ out << "<optgroup>#{content}</optgroup>\n"
2883
+ else
2884
+ out << "<optgroup"
2885
+ options.each do |x,y|
2886
+ x = x.to_s
2887
+ if opts.include?("#{x}")
2888
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2889
+ z = y.join(' ')
2890
+ out << " #{x}='#{z}'"
2891
+ else
2892
+ out << " #{x}='#{y}'"
2893
+ end
2894
+ end
2895
+ end
2896
+ out << ">#{content}</optgroup>\n"
2897
+ end
2898
+ return out
2899
+ end
2900
+ def start_optgroup(options = {})
2901
+ out = ''
2902
+ opts = ['label', 'class', 'id', 'title', 'style', 'onclick', 'ondblclick',
2903
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2904
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
2905
+ if options.nil?
2906
+ out << "<optgroup>\n"
2907
+ else
2908
+ out << "<optgroup"
2909
+ options.each do |x,y|
2910
+ x = x.to_s
2911
+ if opts.include?("#{x}")
2912
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2913
+ z = y.join(' ')
2914
+ out << " #{x}='#{z}'"
2915
+ else
2916
+ out << " #{x}='#{y}'"
2917
+ end
2918
+ end
2919
+ end
2920
+ out << ">\n"
2921
+ end
2922
+ return out
2923
+ end
2924
+ def end_optgroup
2925
+ out = ''
2926
+ out << "</optgroup>\n"
2927
+ return out
2928
+ end
2929
+ def option(content, options = {})
2930
+ out = ''
2931
+ opts = ['selected', 'value', 'disabled', 'label', 'class', 'id',
2932
+ 'title', 'style', 'onclick', 'ondblclick', 'onkeyup',
2933
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2934
+ 'onmouseout', 'onkeypress', 'onkeydown']
2935
+ if options.nil?
2936
+ out << "<option>#{content}</option>\n"
2937
+ else
2938
+ out << "<option"
2939
+ options.each do |x,y|
2940
+ x = x.to_s
2941
+ if opts.include?("#{x}")
2942
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2943
+ z = y.join(' ')
2944
+ out << " #{x}='#{z}'"
2945
+ else
2946
+ out << " #{x}='#{y}'"
2947
+ end
2948
+ end
2949
+ end
2950
+ out << ">#{content}</option>\n"
2951
+ end
2952
+ return out
2953
+ end
2954
+ def start_option(options = {})
2955
+ out = ''
2956
+ opts = ['selected', 'value', 'disabled', 'label', 'class', 'id',
2957
+ 'title', 'style', 'onclick', 'ondblclick', 'onkeyup',
2958
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
2959
+ 'onmouseout', 'onkeypress', 'onkeydown']
2960
+ if options.nil?
2961
+ out << "<option>\n"
2962
+ else
2963
+ out << "<option"
2964
+ options.each do |x,y|
2965
+ x = x.to_s
2966
+ if opts.include?("#{x}")
2967
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2968
+ z = y.join(' ')
2969
+ out << " #{x}='#{z}'"
2970
+ else
2971
+ out << " #{x}='#{y}'"
2972
+ end
2973
+ end
2974
+ end
2975
+ out << ">\n"
2976
+ end
2977
+ return out
2978
+ end
2979
+ def end_option
2980
+ out = ''
2981
+ out << "</option>\n"
2982
+ return out
2983
+ end
2984
+ def param(options = {})
2985
+ out = ''
2986
+ opts = ['name', 'value', 'id', 'type', 'valuetype']
2987
+ if options.nil?
2988
+ out << ""
2989
+ else
2990
+ out << "<param"
2991
+ options.each do |x,y|
2992
+ x = x.to_s
2993
+ if opts.include?("#{x}")
2994
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
2995
+ z = y.join(' ')
2996
+ out << " #{x}='#{z}'"
2997
+ else
2998
+ out << " #{x}='#{y}'"
2999
+ end
3000
+ end
3001
+ end
3002
+ out << " />\n"
3003
+ end
3004
+ return out
3005
+ end
3006
+ def pre(content, options = {})
3007
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3008
+ out << " that you use CSS instead of the b element -->\n"
3009
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
3010
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3011
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3012
+ if options.nil?
3013
+ out << "<pre>#{content}</pre>\n"
3014
+ else
3015
+ out << "<pre"
3016
+ options.each do |x,y|
3017
+ x = x.to_s
3018
+ if opts.include?("#{x}")
3019
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3020
+ z = y.join(' ')
3021
+ out << " #{x}='#{z}'"
3022
+ else
3023
+ out << " #{x}='#{y}'"
3024
+ end
3025
+ end
3026
+ end
3027
+ out << ">#{content}</pre>\n"
3028
+ end
3029
+ return out
3030
+ end
3031
+ def start_pre(options = {})
3032
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3033
+ out << " that you use CSS instead of the b element -->\n"
3034
+ opts = ['class', 'id', 'title', 'style', 'onclick', 'ondblclick',
3035
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3036
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3037
+ if options.nil?
3038
+ out << "<pre>\n"
3039
+ else
3040
+ out << "<pre"
3041
+ options.each do |x,y|
3042
+ x = x.to_s
3043
+ if opts.include?("#{x}")
3044
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3045
+ z = y.join(' ')
3046
+ out << " #{x}='#{z}'"
3047
+ else
3048
+ out << " #{x}='#{y}'"
3049
+ end
3050
+ end
3051
+ end
3052
+ out << ">\n"
3053
+ end
3054
+ return out
3055
+ end
3056
+ def end_pre
3057
+ out = ''
3058
+ out << "</pre>\n"
3059
+ return out
3060
+ end
3061
+ def q(content, options = {})
3062
+ out = ''
3063
+ opts = ['class', 'id', 'title', 'style', 'cite', 'onclick', 'ondblclick',
3064
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3065
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3066
+ if options.nil?
3067
+ out << "<q>#{content}</q>\n"
3068
+ else
3069
+ out << "<q"
3070
+ options.each do |x,y|
3071
+ x = x.to_s
3072
+ if opts.include?("#{x}")
3073
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3074
+ z = y.join(' ')
3075
+ out << " #{x}='#{z}'"
3076
+ else
3077
+ out << " #{x}='#{y}'"
3078
+ end
3079
+ end
3080
+ end
3081
+ out << ">#{content}</q>\n"
3082
+ end
3083
+ return out
3084
+ end
3085
+ def start_q(options = {})
3086
+ out = ''
3087
+ opts = ['class', 'id', 'title', 'style', 'cite', 'onclick', 'ondblclick',
3088
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3089
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3090
+ if options.nil?
3091
+ out << "<q>\n"
3092
+ else
3093
+ out << "<q"
3094
+ options.each do |x,y|
3095
+ x = x.to_s
3096
+ if opts.include?("#{x}")
3097
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3098
+ z = y.join(' ')
3099
+ out << " #{x}='#{z}'"
3100
+ else
3101
+ out << " #{x}='#{y}'"
3102
+ end
3103
+ end
3104
+ end
3105
+ out << ">\n"
3106
+ end
3107
+ return out
3108
+ end
3109
+ def end_q
3110
+ out = ''
3111
+ out << "</q>\n"
3112
+ return out
3113
+ end
3114
+ def samp(content, options = {})
3115
+ out = ''
3116
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3117
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3118
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3119
+ if options.nil?
3120
+ out << "<samp>#{content}</samp>\n"
3121
+ else
3122
+ out << "<samp"
3123
+ options.each do |x,y|
3124
+ x = x.to_s
3125
+ if opts.include?("#{x}")
3126
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3127
+ z = y.join(' ')
3128
+ out << " #{x}='#{z}'"
3129
+ else
3130
+ out << " #{x}='#{y}'"
3131
+ end
3132
+ end
3133
+ end
3134
+ out << ">#{content}</samp>\n"
3135
+ end
3136
+ return out
3137
+ end
3138
+ def start_samp(options = {})
3139
+ out = ''
3140
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3141
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3142
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3143
+ if options.nil?
3144
+ out << "<samp>\n"
3145
+ else
3146
+ out << "<samp"
3147
+ options.each do |x,y|
3148
+ x = x.to_s
3149
+ if opts.include?("#{x}")
3150
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3151
+ z = y.join(' ')
3152
+ out << " #{x}='#{z}'"
3153
+ else
3154
+ out << " #{x}='#{y}'"
3155
+ end
3156
+ end
3157
+ end
3158
+ out << ">\n"
3159
+ end
3160
+ return out
3161
+ end
3162
+ def end_samp
3163
+ out = ''
3164
+ out << "</samp>\n"
3165
+ return out
3166
+ end
3167
+ def select(content, options = {})
3168
+ out = ''
3169
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3170
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3171
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup', 'name',
3172
+ 'multiple', 'size', 'disabled', 'onblur', 'onfocus',
3173
+ 'onchange', 'tabindex']
3174
+ if options.nil?
3175
+ out << "<select>#{content}</select>\n"
3176
+ else
3177
+ out << "<select"
3178
+ options.each do |x,y|
3179
+ x = x.to_s
3180
+ if opts.include?("#{x}")
3181
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3182
+ z = y.join(' ')
3183
+ out << " #{x}='#{z}'"
3184
+ else
3185
+ out << " #{x}='#{y}'"
3186
+ end
3187
+ end
3188
+ end
3189
+ out << ">#{content}</select>\n"
3190
+ end
3191
+ return out
3192
+ end
3193
+ def start_select(options = {})
3194
+ out = ''
3195
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3196
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3197
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup', 'name',
3198
+ 'multiple', 'size', 'disabled', 'onblur', 'onfocus',
3199
+ 'onchange', 'tabindex']
3200
+ if options.nil?
3201
+ out << "<select>\n"
3202
+ else
3203
+ out << "<select"
3204
+ options.each do |x,y|
3205
+ x = x.to_s
3206
+ if opts.include?("#{x}")
3207
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3208
+ z = y.join(' ')
3209
+ out << " #{x}='#{z}'"
3210
+ else
3211
+ out << " #{x}='#{y}'"
3212
+ end
3213
+ end
3214
+ end
3215
+ out << ">\n"
3216
+ end
3217
+ return out
3218
+ end
3219
+ def end_select
3220
+ out = ''
3221
+ out << "</select>\n"
3222
+ return out
3223
+ end
3224
+ def small(content, options = {})
3225
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3226
+ out << " that you use CSS instead of the small element -->\n"
3227
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3228
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3229
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3230
+ if options.nil?
3231
+ out << "<small>#{content}</small>\n"
3232
+ else
3233
+ out << "<small"
3234
+ options.each do |x,y|
3235
+ x = x.to_s
3236
+ if opts.include?("#{x}")
3237
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3238
+ z = y.join(' ')
3239
+ out << " #{x}='#{z}'"
3240
+ else
3241
+ out << " #{x}='#{y}'"
3242
+ end
3243
+ end
3244
+ end
3245
+ out << ">#{content}</small>\n"
3246
+ end
3247
+ return out
3248
+ end
3249
+ def start_small(options = {})
3250
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3251
+ out << " that you use CSS instead of the small element -->\n"
3252
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3253
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3254
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3255
+ if options.nil?
3256
+ out << "<small>\n"
3257
+ else
3258
+ out << "<small"
3259
+ options.each do |x,y|
3260
+ x = x.to_s
3261
+ if opts.include?("#{x}")
3262
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3263
+ z = y.join(' ')
3264
+ out << " #{x}='#{z}'"
3265
+ else
3266
+ out << " #{x}='#{y}'"
3267
+ end
3268
+ end
3269
+ end
3270
+ out << ">\n"
3271
+ end
3272
+ return out
3273
+ end
3274
+ def end_small
3275
+ out = ''
3276
+ out << "</small>\n"
3277
+ return out
3278
+ end
3279
+ def strong(content, options = {})
3280
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3281
+ out << " that you use CSS instead of the strong element -->\n"
3282
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3283
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3284
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3285
+ if options.nil?
3286
+ out << "<strong>#{content}</strong>\n"
3287
+ else
3288
+ out << "<strong"
3289
+ options.each do |x,y|
3290
+ x = x.to_s
3291
+ if opts.include?("#{x}")
3292
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3293
+ z = y.join(' ')
3294
+ out << " #{x}='#{z}'"
3295
+ else
3296
+ out << " #{x}='#{y}'"
3297
+ end
3298
+ end
3299
+ end
3300
+ out << ">#{content}</strong>\n"
3301
+ end
3302
+ return out
3303
+ end
3304
+ def start_strong(options = {})
3305
+ out = '<!-- While a valid part of XHTML, it is highly recommended'
3306
+ out << " that you use CSS instead of the strong element -->\n"
3307
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3308
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3309
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3310
+ if options.nil?
3311
+ out << "<strong>\n"
3312
+ else
3313
+ out << "<strong"
3314
+ options.each do |x,y|
3315
+ x = x.to_s
3316
+ if opts.include?("#{x}")
3317
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3318
+ z = y.join(' ')
3319
+ out << " #{x}='#{z}'"
3320
+ else
3321
+ out << " #{x}='#{y}'"
3322
+ end
3323
+ end
3324
+ end
3325
+ out << ">\n"
3326
+ end
3327
+ return out
3328
+ end
3329
+ def end_strong
3330
+ out = ''
3331
+ out << "</small>\n"
3332
+ return out
3333
+ end
3334
+ def sub(content, options = {})
3335
+ out = ''
3336
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3337
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3338
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3339
+ if options.nil?
3340
+ out << "<sub>#{content}</sub>\n"
3341
+ else
3342
+ out << "<sub"
3343
+ options.each do |x,y|
3344
+ x = x.to_s
3345
+ if opts.include?("#{x}")
3346
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3347
+ z = y.join(' ')
3348
+ out << " #{x}='#{z}'"
3349
+ else
3350
+ out << " #{x}='#{y}'"
3351
+ end
3352
+ end
3353
+ end
3354
+ out << ">#{content}</sub>\n"
3355
+ end
3356
+ return out
3357
+ end
3358
+ def start_sub(options = {})
3359
+ out = ''
3360
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3361
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3362
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3363
+ if options.nil?
3364
+ out << "<sub>\n"
3365
+ else
3366
+ out << "<sub"
3367
+ options.each do |x,y|
3368
+ x = x.to_s
3369
+ if opts.include?("#{x}")
3370
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3371
+ z = y.join(' ')
3372
+ out << " #{x}='#{z}'"
3373
+ else
3374
+ out << " #{x}='#{y}'"
3375
+ end
3376
+ end
3377
+ end
3378
+ out << ">\n"
3379
+ end
3380
+ return out
3381
+ end
3382
+ def end_sub
3383
+ out = ''
3384
+ out << "</sub>\n"
3385
+ return out
3386
+ end
3387
+ def sup(content, options = {})
3388
+ out = ''
3389
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3390
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3391
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3392
+ if options.nil?
3393
+ out << "<sup>#{content}</sup>\n"
3394
+ else
3395
+ out << "<sup"
3396
+ options.each do |x,y|
3397
+ x = x.to_s
3398
+ if opts.include?("#{x}")
3399
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3400
+ z = y.join(' ')
3401
+ out << " #{x}='#{z}'"
3402
+ else
3403
+ out << " #{x}='#{y}'"
3404
+ end
3405
+ end
3406
+ end
3407
+ out << ">#{content}</sup>\n"
3408
+ end
3409
+ return out
3410
+ end
3411
+ def start_sup(options = {})
3412
+ out = ''
3413
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3414
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3415
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3416
+ if options.nil?
3417
+ out << "<sup>\n"
3418
+ else
3419
+ out << "<sup"
3420
+ options.each do |x,y|
3421
+ x = x.to_s
3422
+ if opts.include?("#{x}")
3423
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3424
+ z = y.join(' ')
3425
+ out << " #{x}='#{z}'"
3426
+ else
3427
+ out << " #{x}='#{y}'"
3428
+ end
3429
+ end
3430
+ end
3431
+ out << ">\n"
3432
+ end
3433
+ return out
3434
+ end
3435
+ def end_sup
3436
+ out = ''
3437
+ out << "</sup>\n"
3438
+ return out
3439
+ end
3440
+ def textarea(content, options = {})
3441
+ out = ''
3442
+ opts = ['cols', 'name', 'rows', 'accesskey', 'disabled', 'onblur',
3443
+ 'onchange', 'onfocus', 'onselect', 'readonly', 'tabindex',
3444
+ 'class', 'id', 'title', 'style','onclick', 'ondblclick',
3445
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3446
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3447
+ if options.nil?
3448
+ out << "<textarea>#{content}</textarea>\n"
3449
+ else
3450
+ out << "<textarea"
3451
+ options.each do |x,y|
3452
+ x = x.to_s
3453
+ if opts.include?("#{x}")
3454
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3455
+ z = y.join(' ')
3456
+ out << " #{x}='#{z}'"
3457
+ else
3458
+ out << " #{x}='#{y}'"
3459
+ end
3460
+ end
3461
+ end
3462
+ out << ">#{content}</textarea>\n"
3463
+ end
3464
+ return out
3465
+ end
3466
+ def start_textarea(options = {})
3467
+ out = ''
3468
+ opts = ['cols', 'name', 'rows', 'accesskey', 'disabled', 'onblur',
3469
+ 'onchange', 'onfocus', 'onselect', 'readonly', 'tabindex',
3470
+ 'class', 'id', 'title', 'style','onclick', 'ondblclick',
3471
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3472
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3473
+ if options.nil?
3474
+ out << "<textarea>\n"
3475
+ else
3476
+ out << "<textarea"
3477
+ options.each do |x,y|
3478
+ x = x.to_s
3479
+ if opts.include?("#{x}")
3480
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3481
+ z = y.join(' ')
3482
+ out << " #{x}='#{z}'"
3483
+ else
3484
+ out << " #{x}='#{y}'"
3485
+ end
3486
+ end
3487
+ end
3488
+ out << ">\n"
3489
+ end
3490
+ return out
3491
+ end
3492
+ def end_textarea
3493
+ out = ''
3494
+ out << "</textarea>\n"
3495
+ return out
3496
+ end
3497
+ def title(content)
3498
+ out = ''
3499
+ out << "<title>#{content}</title>\n"
3500
+ return out
3501
+ end
3502
+ def tt(content, options = {})
3503
+ out = ''
3504
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3505
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3506
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3507
+ if options.nil?
3508
+ out << "<tt>#{content}</tt>\n"
3509
+ else
3510
+ out << "<tt"
3511
+ options.each do |x,y|
3512
+ x = x.to_s
3513
+ if opts.include?("#{x}")
3514
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3515
+ z = y.join(' ')
3516
+ out << " #{x}='#{z}'"
3517
+ else
3518
+ out << " #{x}='#{y}'"
3519
+ end
3520
+ end
3521
+ end
3522
+ out << ">#{content}</tt>\n"
3523
+ end
3524
+ return out
3525
+ end
3526
+ def start_tt(options = {})
3527
+ out = ''
3528
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3529
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3530
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3531
+ if options.nil?
3532
+ out << "<tt>\n"
3533
+ else
3534
+ out << "<tt"
3535
+ options.each do |x,y|
3536
+ x = x.to_s
3537
+ if opts.include?("#{x}")
3538
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3539
+ z = y.join(' ')
3540
+ out << " #{x}='#{z}'"
3541
+ else
3542
+ out << " #{x}='#{y}'"
3543
+ end
3544
+ end
3545
+ end
3546
+ out << ">\n"
3547
+ end
3548
+ return out
3549
+ end
3550
+ def end_tt
3551
+ out = ''
3552
+ out << "</tt>\n"
3553
+ return out
3554
+ end
3555
+ def var(content, options = {})
3556
+ out = ''
3557
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3558
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3559
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3560
+ if options.nil?
3561
+ out << "<var>#{content}</var>\n"
3562
+ else
3563
+ out << "<var"
3564
+ options.each do |x,y|
3565
+ x = x.to_s
3566
+ if opts.include?("#{x}")
3567
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3568
+ z = y.join(' ')
3569
+ out << " #{x}='#{z}'"
3570
+ else
3571
+ out << " #{x}='#{y}'"
3572
+ end
3573
+ end
3574
+ end
3575
+ out << ">#{content}</var>\n"
3576
+ end
3577
+ return out
3578
+ end
3579
+ def start_var(options = {})
3580
+ out = ''
3581
+ opts = ['class', 'id', 'title', 'style','onclick', 'ondblclick',
3582
+ 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove',
3583
+ 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup']
3584
+ if options.nil?
3585
+ out << "<var>\n"
3586
+ else
3587
+ out << "<var"
3588
+ options.each do |x,y|
3589
+ x = x.to_s
3590
+ if opts.include?("#{x}")
3591
+ if ( "#{x}" == 'class' or "#{x}" == 'id' and y.kind_of?(Array))
3592
+ z = y.join(' ')
3593
+ out << " #{x}='#{z}'"
3594
+ else
3595
+ out << " #{x}='#{y}'"
3596
+ end
3597
+ end
3598
+ end
3599
+ out << ">\n"
3600
+ end
3601
+ return out
3602
+ end
3603
+ def end_var
3604
+ out = ''
3605
+ return out
3606
+ end
3607
+ end