phlex 1.3.1 → 1.4.0
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -24
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/README.md +1 -0
- data/fixtures/view_helper.rb +6 -0
- data/lib/phlex/black_hole.rb +7 -9
- data/lib/phlex/callable.rb +3 -5
- data/lib/phlex/deferred_render.rb +2 -4
- data/lib/phlex/elements.rb +56 -50
- data/lib/phlex/helpers.rb +5 -2
- data/lib/phlex/html/standard_elements.rb +590 -0
- data/lib/phlex/html/void_elements.rb +79 -0
- data/lib/phlex/html.rb +14 -410
- data/lib/{overrides → phlex/overrides}/symbol/name.rb +1 -1
- data/lib/phlex/sgml.rb +315 -0
- data/lib/phlex/svg/standard_elements.rb +391 -0
- data/lib/phlex/svg.rb +11 -0
- data/lib/phlex/testing/view_helper.rb +10 -8
- data/lib/phlex/unbuffered.rb +34 -36
- data/lib/phlex/version.rb +1 -1
- data/lib/phlex.rb +5 -1
- metadata +9 -5
- data/lib/phlex/buffered.rb +0 -19
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Phlex::HTML::StandardElements
|
|
4
|
+
extend Phlex::Elements
|
|
5
|
+
|
|
6
|
+
REGISTERED_ELEMENTS = Concurrent::Map.new
|
|
7
|
+
|
|
8
|
+
# @!method a(**attributes, &content)
|
|
9
|
+
# Outputs an <code>a</code> tag
|
|
10
|
+
# @return [nil]
|
|
11
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/a
|
|
12
|
+
register_element :a, tag: "a"
|
|
13
|
+
|
|
14
|
+
# @!method abbr(**attributes, &content)
|
|
15
|
+
# Outputs an <code>abbr</code> tag
|
|
16
|
+
# @return [nil]
|
|
17
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/abbr
|
|
18
|
+
register_element :abbr, tag: "abbr"
|
|
19
|
+
|
|
20
|
+
# @!method address(**attributes, &content)
|
|
21
|
+
# Outputs an <code>address</code> tag
|
|
22
|
+
# @return [nil]
|
|
23
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/address
|
|
24
|
+
register_element :address, tag: "address"
|
|
25
|
+
|
|
26
|
+
# @!method article(**attributes, &content)
|
|
27
|
+
# Outputs an <code>article</code> tag
|
|
28
|
+
# @return [nil]
|
|
29
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/article
|
|
30
|
+
register_element :article, tag: "article"
|
|
31
|
+
|
|
32
|
+
# @!method aside(**attributes, &content)
|
|
33
|
+
# Outputs an <code>aside</code> tag
|
|
34
|
+
# @return [nil]
|
|
35
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/aside
|
|
36
|
+
register_element :aside, tag: "aside"
|
|
37
|
+
|
|
38
|
+
# @!method b(**attributes, &content)
|
|
39
|
+
# Outputs a <code>b</code> tag
|
|
40
|
+
# @return [nil]
|
|
41
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/b
|
|
42
|
+
register_element :b, tag: "b"
|
|
43
|
+
|
|
44
|
+
# @!method bdi(**attributes, &content)
|
|
45
|
+
# Outputs a <code>bdi</code> tag
|
|
46
|
+
# @return [nil]
|
|
47
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/bdi
|
|
48
|
+
register_element :bdi, tag: "bdi"
|
|
49
|
+
|
|
50
|
+
# @!method bdo(**attributes, &content)
|
|
51
|
+
# Outputs a <code>bdo</code> tag
|
|
52
|
+
# @return [nil]
|
|
53
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/bdo
|
|
54
|
+
register_element :bdo, tag: "bdo"
|
|
55
|
+
|
|
56
|
+
# @!method blockquote(**attributes, &content)
|
|
57
|
+
# Outputs a <code>blockquote</code> tag
|
|
58
|
+
# @return [nil]
|
|
59
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/blockquote
|
|
60
|
+
register_element :blockquote, tag: "blockquote"
|
|
61
|
+
|
|
62
|
+
# @!method body(**attributes, &content)
|
|
63
|
+
# Outputs a <code>body</code> tag
|
|
64
|
+
# @return [nil]
|
|
65
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/body
|
|
66
|
+
register_element :body, tag: "body"
|
|
67
|
+
|
|
68
|
+
# @!method button(**attributes, &content)
|
|
69
|
+
# Outputs a <code>button</code> tag
|
|
70
|
+
# @return [nil]
|
|
71
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/button
|
|
72
|
+
register_element :button, tag: "button"
|
|
73
|
+
|
|
74
|
+
# @!method caption(**attributes, &content)
|
|
75
|
+
# Outputs a <code>caption</code> tag
|
|
76
|
+
# @return [nil]
|
|
77
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/caption
|
|
78
|
+
register_element :caption, tag: "caption"
|
|
79
|
+
|
|
80
|
+
# @!method cite(**attributes, &content)
|
|
81
|
+
# Outputs a <code>cite</code> tag
|
|
82
|
+
# @return [nil]
|
|
83
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/cite
|
|
84
|
+
register_element :cite, tag: "cite"
|
|
85
|
+
|
|
86
|
+
# @!method code(**attributes, &content)
|
|
87
|
+
# Outputs a <code>code</code> tag
|
|
88
|
+
# @return [nil]
|
|
89
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/code
|
|
90
|
+
register_element :code, tag: "code"
|
|
91
|
+
|
|
92
|
+
# @!method colgroup(**attributes, &content)
|
|
93
|
+
# Outputs a <code>colgroup</code> tag
|
|
94
|
+
# @return [nil]
|
|
95
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/colgroup
|
|
96
|
+
register_element :colgroup, tag: "colgroup"
|
|
97
|
+
|
|
98
|
+
# @!method data(**attributes, &content)
|
|
99
|
+
# Outputs a <code>data</code> tag
|
|
100
|
+
# @return [nil]
|
|
101
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/data
|
|
102
|
+
register_element :data, tag: "data"
|
|
103
|
+
|
|
104
|
+
# @!method datalist(**attributes, &content)
|
|
105
|
+
# Outputs a <code>datalist</code> tag
|
|
106
|
+
# @return [nil]
|
|
107
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/datalist
|
|
108
|
+
register_element :datalist, tag: "datalist"
|
|
109
|
+
|
|
110
|
+
# @!method dd(**attributes, &content)
|
|
111
|
+
# Outputs a <code>dd</code> tag
|
|
112
|
+
# @return [nil]
|
|
113
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/dd
|
|
114
|
+
register_element :dd, tag: "dd"
|
|
115
|
+
|
|
116
|
+
# @!method del(**attributes, &content)
|
|
117
|
+
# Outputs a <code>del</code> tag
|
|
118
|
+
# @return [nil]
|
|
119
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/del
|
|
120
|
+
register_element :del, tag: "del"
|
|
121
|
+
|
|
122
|
+
# @!method details(**attributes, &content)
|
|
123
|
+
# Outputs a <code>details</code> tag
|
|
124
|
+
# @return [nil]
|
|
125
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/details
|
|
126
|
+
register_element :details, tag: "details"
|
|
127
|
+
|
|
128
|
+
# @!method dfn(**attributes, &content)
|
|
129
|
+
# Outputs a <code>dfn</code> tag
|
|
130
|
+
# @return [nil]
|
|
131
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/dfn
|
|
132
|
+
register_element :dfn, tag: "dfn"
|
|
133
|
+
|
|
134
|
+
# @!method dialog(**attributes, &content)
|
|
135
|
+
# Outputs a <code>dialog</code> tag
|
|
136
|
+
# @return [nil]
|
|
137
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/dialog
|
|
138
|
+
register_element :dialog, tag: "dialog"
|
|
139
|
+
|
|
140
|
+
# @!method div(**attributes, &content)
|
|
141
|
+
# Outputs a <code>div</code> tag
|
|
142
|
+
# @return [nil]
|
|
143
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/div
|
|
144
|
+
register_element :div, tag: "div"
|
|
145
|
+
|
|
146
|
+
# @!method dl(**attributes, &content)
|
|
147
|
+
# Outputs a <code>dl</code> tag
|
|
148
|
+
# @return [nil]
|
|
149
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/dl
|
|
150
|
+
register_element :dl, tag: "dl"
|
|
151
|
+
|
|
152
|
+
# @!method dt(**attributes, &content)
|
|
153
|
+
# Outputs a <code>dt</code> tag
|
|
154
|
+
# @return [nil]
|
|
155
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/dt
|
|
156
|
+
register_element :dt, tag: "dt"
|
|
157
|
+
|
|
158
|
+
# @!method em(**attributes, &content)
|
|
159
|
+
# Outputs an <code>em</code> tag
|
|
160
|
+
# @return [nil]
|
|
161
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/em
|
|
162
|
+
register_element :em, tag: "em"
|
|
163
|
+
|
|
164
|
+
# @!method fieldset(**attributes, &content)
|
|
165
|
+
# Outputs a <code>fieldset</code> tag
|
|
166
|
+
# @return [nil]
|
|
167
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/fieldset
|
|
168
|
+
register_element :fieldset, tag: "fieldset"
|
|
169
|
+
|
|
170
|
+
# @!method figcaption(**attributes, &content)
|
|
171
|
+
# Outputs a <code>figcaption</code> tag
|
|
172
|
+
# @return [nil]
|
|
173
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/figcaption
|
|
174
|
+
register_element :figcaption, tag: "figcaption"
|
|
175
|
+
|
|
176
|
+
# @!method figure(**attributes, &content)
|
|
177
|
+
# Outputs a <code>figure</code> tag
|
|
178
|
+
# @return [nil]
|
|
179
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/figure
|
|
180
|
+
register_element :figure, tag: "figure"
|
|
181
|
+
|
|
182
|
+
# @!method footer(**attributes, &content)
|
|
183
|
+
# Outputs a <code>footer</code> tag
|
|
184
|
+
# @return [nil]
|
|
185
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/footer
|
|
186
|
+
register_element :footer, tag: "footer"
|
|
187
|
+
|
|
188
|
+
# @!method form(**attributes, &content)
|
|
189
|
+
# Outputs a <code>form</code> tag
|
|
190
|
+
# @return [nil]
|
|
191
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/form
|
|
192
|
+
register_element :form, tag: "form"
|
|
193
|
+
|
|
194
|
+
# @!method h1(**attributes, &content)
|
|
195
|
+
# Outputs an <code>h1</code> tag
|
|
196
|
+
# @return [nil]
|
|
197
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h1
|
|
198
|
+
register_element :h1, tag: "h1"
|
|
199
|
+
|
|
200
|
+
# @!method h2(**attributes, &content)
|
|
201
|
+
# Outputs an <code>h2</code> tag
|
|
202
|
+
# @return [nil]
|
|
203
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h2
|
|
204
|
+
register_element :h2, tag: "h2"
|
|
205
|
+
|
|
206
|
+
# @!method h3(**attributes, &content)
|
|
207
|
+
# Outputs an <code>h3</code> tag
|
|
208
|
+
# @return [nil]
|
|
209
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h3
|
|
210
|
+
register_element :h3, tag: "h3"
|
|
211
|
+
|
|
212
|
+
# @!method h4(**attributes, &content)
|
|
213
|
+
# Outputs an <code>h4</code> tag
|
|
214
|
+
# @return [nil]
|
|
215
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h4
|
|
216
|
+
register_element :h4, tag: "h4"
|
|
217
|
+
|
|
218
|
+
# @!method h5(**attributes, &content)
|
|
219
|
+
# Outputs an <code>h5</code> tag
|
|
220
|
+
# @return [nil]
|
|
221
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h5
|
|
222
|
+
register_element :h5, tag: "h5"
|
|
223
|
+
|
|
224
|
+
# @!method h6(**attributes, &content)
|
|
225
|
+
# Outputs an <code>h6</code> tag
|
|
226
|
+
# @return [nil]
|
|
227
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/h6
|
|
228
|
+
register_element :h6, tag: "h6"
|
|
229
|
+
|
|
230
|
+
# @!method head(**attributes, &content)
|
|
231
|
+
# Outputs a <code>head</code> tag
|
|
232
|
+
# @return [nil]
|
|
233
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/head
|
|
234
|
+
register_element :head, tag: "head"
|
|
235
|
+
|
|
236
|
+
# @!method header(**attributes, &content)
|
|
237
|
+
# Outputs a <code>header</code> tag
|
|
238
|
+
# @return [nil]
|
|
239
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/header
|
|
240
|
+
register_element :header, tag: "header"
|
|
241
|
+
|
|
242
|
+
# @!method hgroup(**attributes, &content)
|
|
243
|
+
# Outputs a <code>hgroup</code> tag
|
|
244
|
+
# @return [nil]
|
|
245
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/hgroup
|
|
246
|
+
register_element :hgroup, tag: "hgroup"
|
|
247
|
+
|
|
248
|
+
# @!method html(**attributes, &content)
|
|
249
|
+
# Outputs a <code>html</code> tag
|
|
250
|
+
# @return [nil]
|
|
251
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/html
|
|
252
|
+
register_element :html, tag: "html"
|
|
253
|
+
|
|
254
|
+
# @!method i(**attributes, &content)
|
|
255
|
+
# Outputs an <code>i</code> tag
|
|
256
|
+
# @return [nil]
|
|
257
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/i
|
|
258
|
+
register_element :i, tag: "i"
|
|
259
|
+
|
|
260
|
+
# @!method iframe(**attributes, &content)
|
|
261
|
+
# Outputs an <code>iframe</code> tag
|
|
262
|
+
# @return [nil]
|
|
263
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/iframe
|
|
264
|
+
register_element :iframe, tag: "iframe"
|
|
265
|
+
|
|
266
|
+
# @!method ins(**attributes, &content)
|
|
267
|
+
# Outputs an <code>ins</code> tag
|
|
268
|
+
# @return [nil]
|
|
269
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/ins
|
|
270
|
+
register_element :ins, tag: "ins"
|
|
271
|
+
|
|
272
|
+
# @!method kbd(**attributes, &content)
|
|
273
|
+
# Outputs a <code>kbd</code> tag
|
|
274
|
+
# @return [nil]
|
|
275
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/kbd
|
|
276
|
+
register_element :kbd, tag: "kbd"
|
|
277
|
+
|
|
278
|
+
# @!method label(**attributes, &content)
|
|
279
|
+
# Outputs a <code>label</code> tag
|
|
280
|
+
# @return [nil]
|
|
281
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/label
|
|
282
|
+
register_element :label, tag: "label"
|
|
283
|
+
|
|
284
|
+
# @!method legend(**attributes, &content)
|
|
285
|
+
# Outputs a <code>legend</code> tag
|
|
286
|
+
# @return [nil]
|
|
287
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/legend
|
|
288
|
+
register_element :legend, tag: "legend"
|
|
289
|
+
|
|
290
|
+
# @!method li(**attributes, &content)
|
|
291
|
+
# Outputs a <code>li</code> tag
|
|
292
|
+
# @return [nil]
|
|
293
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/li
|
|
294
|
+
register_element :li, tag: "li"
|
|
295
|
+
|
|
296
|
+
# @!method main(**attributes, &content)
|
|
297
|
+
# Outputs a <code>main</code> tag
|
|
298
|
+
# @return [nil]
|
|
299
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/main
|
|
300
|
+
register_element :main, tag: "main"
|
|
301
|
+
|
|
302
|
+
# @!method map(**attributes, &content)
|
|
303
|
+
# Outputs a <code>map</code> tag
|
|
304
|
+
# @return [nil]
|
|
305
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/map
|
|
306
|
+
register_element :map, tag: "map"
|
|
307
|
+
|
|
308
|
+
# @!method mark(**attributes, &content)
|
|
309
|
+
# Outputs a <code>mark</code> tag
|
|
310
|
+
# @return [nil]
|
|
311
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/mark
|
|
312
|
+
register_element :mark, tag: "mark"
|
|
313
|
+
|
|
314
|
+
# @!method menuitem(**attributes, &content)
|
|
315
|
+
# Outputs a <code>menuitem</code> tag
|
|
316
|
+
# @return [nil]
|
|
317
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/menuitem
|
|
318
|
+
# @deprecated
|
|
319
|
+
register_element :menuitem, tag: "menuitem"
|
|
320
|
+
|
|
321
|
+
# @!method meter(**attributes, &content)
|
|
322
|
+
# Outputs a <code>meter</code> tag
|
|
323
|
+
# @return [nil]
|
|
324
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/meter
|
|
325
|
+
register_element :meter, tag: "meter"
|
|
326
|
+
|
|
327
|
+
# @!method nav(**attributes, &content)
|
|
328
|
+
# Outputs a <code>nav</code> tag
|
|
329
|
+
# @return [nil]
|
|
330
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/nav
|
|
331
|
+
register_element :nav, tag: "nav"
|
|
332
|
+
|
|
333
|
+
# @!method noscript(**attributes, &content)
|
|
334
|
+
# Outputs a <code>noscript</code> tag
|
|
335
|
+
# @return [nil]
|
|
336
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/noscript
|
|
337
|
+
register_element :noscript, tag: "noscript"
|
|
338
|
+
|
|
339
|
+
# @!method object(**attributes, &content)
|
|
340
|
+
# Outputs an <code>object</code> tag
|
|
341
|
+
# @return [nil]
|
|
342
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/object
|
|
343
|
+
register_element :object, tag: "object"
|
|
344
|
+
|
|
345
|
+
# @!method ol(**attributes, &content)
|
|
346
|
+
# Outputs an <code>ol</code> tag
|
|
347
|
+
# @return [nil]
|
|
348
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/ol
|
|
349
|
+
register_element :ol, tag: "ol"
|
|
350
|
+
|
|
351
|
+
# @!method optgroup(**attributes, &content)
|
|
352
|
+
# Outputs an <code>optgroup</code> tag
|
|
353
|
+
# @return [nil]
|
|
354
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/optgroup
|
|
355
|
+
register_element :optgroup, tag: "optgroup"
|
|
356
|
+
|
|
357
|
+
# @!method option(**attributes, &content)
|
|
358
|
+
# Outputs an <code>option</code> tag
|
|
359
|
+
# @return [nil]
|
|
360
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/option
|
|
361
|
+
register_element :option, tag: "option"
|
|
362
|
+
|
|
363
|
+
# @!method output(**attributes, &content)
|
|
364
|
+
# Outputs an <code>output</code> tag
|
|
365
|
+
# @return [nil]
|
|
366
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/output
|
|
367
|
+
register_element :output, tag: "output"
|
|
368
|
+
|
|
369
|
+
# @!method p(**attributes, &content)
|
|
370
|
+
# Outputs a <code>p</code> tag
|
|
371
|
+
# @return [nil]
|
|
372
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/p
|
|
373
|
+
register_element :p, tag: "p"
|
|
374
|
+
|
|
375
|
+
# @!method picture(**attributes, &content)
|
|
376
|
+
# Outputs a <code>picture</code> tag
|
|
377
|
+
# @return [nil]
|
|
378
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/picture
|
|
379
|
+
register_element :picture, tag: "picture"
|
|
380
|
+
|
|
381
|
+
# @!method pre(**attributes, &content)
|
|
382
|
+
# Outputs a <code>pre</code> tag
|
|
383
|
+
# @return [nil]
|
|
384
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/pre
|
|
385
|
+
register_element :pre, tag: "pre"
|
|
386
|
+
|
|
387
|
+
# @!method progress(**attributes, &content)
|
|
388
|
+
# Outputs a <code>progress</code> tag
|
|
389
|
+
# @return [nil]
|
|
390
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/progress
|
|
391
|
+
register_element :progress, tag: "progress"
|
|
392
|
+
|
|
393
|
+
# @!method q(**attributes, &content)
|
|
394
|
+
# Outputs a <code>q</code> tag
|
|
395
|
+
# @return [nil]
|
|
396
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/q
|
|
397
|
+
register_element :q, tag: "q"
|
|
398
|
+
|
|
399
|
+
# @!method rp(**attributes, &content)
|
|
400
|
+
# Outputs a <code>rp</code> tag
|
|
401
|
+
# @return [nil]
|
|
402
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/rp
|
|
403
|
+
register_element :rp, tag: "rp"
|
|
404
|
+
|
|
405
|
+
# @!method rt(**attributes, &content)
|
|
406
|
+
# Outputs a <code>rt</code> tag
|
|
407
|
+
# @return [nil]
|
|
408
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/rt
|
|
409
|
+
register_element :rt, tag: "rt"
|
|
410
|
+
|
|
411
|
+
# @!method ruby(**attributes, &content)
|
|
412
|
+
# Outputs a <code>ruby</code> tag
|
|
413
|
+
# @return [nil]
|
|
414
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/ruby
|
|
415
|
+
register_element :ruby, tag: "ruby"
|
|
416
|
+
|
|
417
|
+
# @!method s(**attributes, &content)
|
|
418
|
+
# Outputs a <code>s</code> tag
|
|
419
|
+
# @return [nil]
|
|
420
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/s
|
|
421
|
+
register_element :s, tag: "s"
|
|
422
|
+
|
|
423
|
+
# @!method samp(**attributes, &content)
|
|
424
|
+
# Outputs a <code>samp</code> tag
|
|
425
|
+
# @return [nil]
|
|
426
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/samp
|
|
427
|
+
register_element :samp, tag: "samp"
|
|
428
|
+
|
|
429
|
+
# @!method script(**attributes, &content)
|
|
430
|
+
# Outputs a <code>script</code> tag
|
|
431
|
+
# @return [nil]
|
|
432
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/script
|
|
433
|
+
register_element :script, tag: "script"
|
|
434
|
+
|
|
435
|
+
# @!method section(**attributes, &content)
|
|
436
|
+
# Outputs a <code>section</code> tag
|
|
437
|
+
# @return [nil]
|
|
438
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/section
|
|
439
|
+
register_element :section, tag: "section"
|
|
440
|
+
|
|
441
|
+
# @!method select(**attributes, &content)
|
|
442
|
+
# Outputs a <code>select</code> tag
|
|
443
|
+
# @return [nil]
|
|
444
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/select
|
|
445
|
+
register_element :select, tag: "select"
|
|
446
|
+
|
|
447
|
+
# @!method slot(**attributes, &content)
|
|
448
|
+
# Outputs a <code>slot</code> tag
|
|
449
|
+
# @return [nil]
|
|
450
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/slot
|
|
451
|
+
register_element :slot, tag: "slot"
|
|
452
|
+
|
|
453
|
+
# @!method small(**attributes, &content)
|
|
454
|
+
# Outputs a <code>small</code> tag
|
|
455
|
+
# @return [nil]
|
|
456
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/small
|
|
457
|
+
register_element :small, tag: "small"
|
|
458
|
+
|
|
459
|
+
# @!method span(**attributes, &content)
|
|
460
|
+
# Outputs a <code>span</code> tag
|
|
461
|
+
# @return [nil]
|
|
462
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/span
|
|
463
|
+
register_element :span, tag: "span"
|
|
464
|
+
|
|
465
|
+
# @!method strong(**attributes, &content)
|
|
466
|
+
# Outputs a <code>strong</code> tag
|
|
467
|
+
# @return [nil]
|
|
468
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/strong
|
|
469
|
+
register_element :strong, tag: "strong"
|
|
470
|
+
|
|
471
|
+
# @!method style(**attributes, &content)
|
|
472
|
+
# Outputs a <code>style</code> tag
|
|
473
|
+
# @return [nil]
|
|
474
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/style
|
|
475
|
+
register_element :style, tag: "style"
|
|
476
|
+
|
|
477
|
+
# @!method sub(**attributes, &content)
|
|
478
|
+
# Outputs a <code>sub</code> tag
|
|
479
|
+
# @return [nil]
|
|
480
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/sub
|
|
481
|
+
register_element :sub, tag: "sub"
|
|
482
|
+
|
|
483
|
+
# @!method summary(**attributes, &content)
|
|
484
|
+
# Outputs a <code>summary</code> tag
|
|
485
|
+
# @return [nil]
|
|
486
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/summary
|
|
487
|
+
register_element :summary, tag: "summary"
|
|
488
|
+
|
|
489
|
+
# @!method sup(**attributes, &content)
|
|
490
|
+
# Outputs a <code>sup</code> tag
|
|
491
|
+
# @return [nil]
|
|
492
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/sup
|
|
493
|
+
register_element :sup, tag: "sup"
|
|
494
|
+
|
|
495
|
+
# @!method svg(**attributes, &content)
|
|
496
|
+
# Outputs a <code>svg</code> tag
|
|
497
|
+
# @return [nil]
|
|
498
|
+
# @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg
|
|
499
|
+
register_element :svg, tag: "svg"
|
|
500
|
+
|
|
501
|
+
# @!method table(**attributes, &content)
|
|
502
|
+
# Outputs a <code>table</code> tag
|
|
503
|
+
# @return [nil]
|
|
504
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/table
|
|
505
|
+
register_element :table, tag: "table"
|
|
506
|
+
|
|
507
|
+
# @!method tbody(**attributes, &content)
|
|
508
|
+
# Outputs a <code>tbody</code> tag
|
|
509
|
+
# @return [nil]
|
|
510
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/tbody
|
|
511
|
+
register_element :tbody, tag: "tbody"
|
|
512
|
+
|
|
513
|
+
# @!method td(**attributes, &content)
|
|
514
|
+
# Outputs a <code>td</code> tag
|
|
515
|
+
# @return [nil]
|
|
516
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/td
|
|
517
|
+
register_element :td, tag: "td"
|
|
518
|
+
|
|
519
|
+
# @!method template_tag(**attributes, &content)
|
|
520
|
+
# Outputs a <code>template</code> tag
|
|
521
|
+
# @return [nil]
|
|
522
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/template
|
|
523
|
+
register_element :template_tag, tag: "template"
|
|
524
|
+
|
|
525
|
+
# @!method textarea(**attributes, &content)
|
|
526
|
+
# Outputs a <code>textarea</code> tag
|
|
527
|
+
# @return [nil]
|
|
528
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/textarea
|
|
529
|
+
register_element :textarea, tag: "textarea"
|
|
530
|
+
|
|
531
|
+
# @!method tfoot(**attributes, &content)
|
|
532
|
+
# Outputs a <code>tfoot</code> tag
|
|
533
|
+
# @return [nil]
|
|
534
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/tfoot
|
|
535
|
+
register_element :tfoot, tag: "tfoot"
|
|
536
|
+
|
|
537
|
+
# @!method th(**attributes, &content)
|
|
538
|
+
# Outputs a <code>th</code> tag
|
|
539
|
+
# @return [nil]
|
|
540
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/th
|
|
541
|
+
register_element :th, tag: "th"
|
|
542
|
+
|
|
543
|
+
# @!method thead(**attributes, &content)
|
|
544
|
+
# Outputs a <code>thead</code> tag
|
|
545
|
+
# @return [nil]
|
|
546
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/thead
|
|
547
|
+
register_element :thead, tag: "thead"
|
|
548
|
+
|
|
549
|
+
# @!method time(**attributes, &content)
|
|
550
|
+
# Outputs a <code>time</code> tag
|
|
551
|
+
# @return [nil]
|
|
552
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/time
|
|
553
|
+
register_element :time, tag: "time"
|
|
554
|
+
|
|
555
|
+
# @!method title(**attributes, &content)
|
|
556
|
+
# Outputs a <code>title</code> tag
|
|
557
|
+
# @return [nil]
|
|
558
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/title
|
|
559
|
+
register_element :title, tag: "title"
|
|
560
|
+
|
|
561
|
+
# @!method tr(**attributes, &content)
|
|
562
|
+
# Outputs a <code>tr</code> tag
|
|
563
|
+
# @return [nil]
|
|
564
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/tr
|
|
565
|
+
register_element :tr, tag: "tr"
|
|
566
|
+
|
|
567
|
+
# @!method u(**attributes, &content)
|
|
568
|
+
# Outputs an <code>u</code> tag
|
|
569
|
+
# @return [nil]
|
|
570
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/u
|
|
571
|
+
register_element :u, tag: "u"
|
|
572
|
+
|
|
573
|
+
# @!method ul(**attributes, &content)
|
|
574
|
+
# Outputs an <code>ul</code> tag
|
|
575
|
+
# @return [nil]
|
|
576
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/ul
|
|
577
|
+
register_element :ul, tag: "ul"
|
|
578
|
+
|
|
579
|
+
# @!method video(**attributes, &content)
|
|
580
|
+
# Outputs a <code>video</code> tag
|
|
581
|
+
# @return [nil]
|
|
582
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/video
|
|
583
|
+
register_element :video, tag: "video"
|
|
584
|
+
|
|
585
|
+
# @!method wbr(**attributes, &content)
|
|
586
|
+
# Outputs a <code>wbr</code> tag
|
|
587
|
+
# @return [nil]
|
|
588
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/wbr
|
|
589
|
+
register_element :wbr, tag: "wbr"
|
|
590
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Phlex::HTML::VoidElements
|
|
4
|
+
extend Phlex::Elements
|
|
5
|
+
|
|
6
|
+
REGISTERED_ELEMENTS = Concurrent::Map.new
|
|
7
|
+
|
|
8
|
+
# @!method area(**attributes, &content)
|
|
9
|
+
# Outputs an <code>area</code> tag
|
|
10
|
+
# @return [nil]
|
|
11
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/area
|
|
12
|
+
register_void_element :area, tag: "area"
|
|
13
|
+
|
|
14
|
+
# @!method br(**attributes, &content)
|
|
15
|
+
# Outputs a <code>br</code> tag
|
|
16
|
+
# @return [nil]
|
|
17
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/br
|
|
18
|
+
register_void_element :br, tag: "br"
|
|
19
|
+
|
|
20
|
+
# @!method embed(**attributes, &content)
|
|
21
|
+
# Outputs an <code>embed</code> tag
|
|
22
|
+
# @return [nil]
|
|
23
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/embed
|
|
24
|
+
register_void_element :embed, tag: "embed"
|
|
25
|
+
|
|
26
|
+
# @!method hr(**attributes, &content)
|
|
27
|
+
# Outputs a <code>hr</code> tag
|
|
28
|
+
# @return [nil]
|
|
29
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/hr
|
|
30
|
+
register_void_element :hr, tag: "hr"
|
|
31
|
+
|
|
32
|
+
# @!method img(**attributes, &content)
|
|
33
|
+
# Outputs an <code>img</code> tag
|
|
34
|
+
# @return [nil]
|
|
35
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/img
|
|
36
|
+
register_void_element :img, tag: "img"
|
|
37
|
+
|
|
38
|
+
# @!method input(**attributes, &content)
|
|
39
|
+
# Outputs an <code>input</code> tag
|
|
40
|
+
# @return [nil]
|
|
41
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/input
|
|
42
|
+
register_void_element :input, tag: "input"
|
|
43
|
+
|
|
44
|
+
# @!method link(**attributes, &content)
|
|
45
|
+
# Outputs a <code>link</code> tag
|
|
46
|
+
# @return [nil]
|
|
47
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/link
|
|
48
|
+
register_void_element :link, tag: "link"
|
|
49
|
+
|
|
50
|
+
# @!method meta(**attributes, &content)
|
|
51
|
+
# Outputs a <code>meta</code> tag
|
|
52
|
+
# @return [nil]
|
|
53
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/meta
|
|
54
|
+
register_void_element :meta, tag: "meta"
|
|
55
|
+
|
|
56
|
+
# @!method param(**attributes, &content)
|
|
57
|
+
# Outputs a <code>param</code> tag
|
|
58
|
+
# @return [nil]
|
|
59
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/param
|
|
60
|
+
register_void_element :param, tag: "param"
|
|
61
|
+
|
|
62
|
+
# @!method source(**attributes, &content)
|
|
63
|
+
# Outputs a <code>source</code> tag
|
|
64
|
+
# @return [nil]
|
|
65
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/source
|
|
66
|
+
register_void_element :source, tag: "source"
|
|
67
|
+
|
|
68
|
+
# @!method track(**attributes, &content)
|
|
69
|
+
# Outputs a <code>track</code> tag
|
|
70
|
+
# @return [nil]
|
|
71
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/track
|
|
72
|
+
register_void_element :track, tag: "track"
|
|
73
|
+
|
|
74
|
+
# @!method col(**attributes, &content)
|
|
75
|
+
# Outputs a <code>col</code> tag
|
|
76
|
+
# @return [nil]
|
|
77
|
+
# @see https://developer.mozilla.org/docs/Web/HTML/Element/col
|
|
78
|
+
register_void_element :col, tag: "col"
|
|
79
|
+
end
|