@@ -9,7 +9,7 @@ exports[`cli should not override config with cli defaults 1`] = `
9
9
"import * as React from \\ "react\\ ";
10
10
11
11
function SvgFile() {
12
- return <svg viewBox =\\"0 0 48 1\\"><title>{\\"Rectangle 5\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id =\\"Page-1\\" stroke =\\"none\\" strokeWidth = { 1 } fill =\\"none\\" fillRule =\\"evenodd\\"><g id =\\"19-Separator\\" transform =\\"translate(-129.000000, -156.000000)\\" fill =\\"#063855\\"><g id =\\"Controls/Settings\\" transform =\\"translate(80.000000, 0.000000)\\"><g id =\\"Content\\" transform =\\"translate(0.000000, 64.000000)\\"><g id =\\"Group\\" transform =\\"translate(24.000000, 56.000000)\\"><g id =\\"Group-2\\"><rect id =\\"Rectangle-5\\" x = { 25 } y = { 36 } width = { 48 } height = { 1 } />< / g></ g >< / g></ g >< / g></ g >< / svg > ;
12
+ return <svg viewBox =\\"0 0 48 1\\" xmlns =\\"http://www.w3.org/2000/svg\\" xmlnsXlink =\\"http://www.w3.org/1999/xlink\\" ><title>{\\"Rectangle 5\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id =\\"Page-1\\" stroke =\\"none\\" strokeWidth = { 1 } fill =\\"none\\" fillRule =\\"evenodd\\"><g id =\\"19-Separator\\" transform =\\"translate(-129.000000, -156.000000)\\" fill =\\"#063855\\"><g id =\\"Controls/Settings\\" transform =\\"translate(80.000000, 0.000000)\\"><g id =\\"Content\\" transform =\\"translate(0.000000, 64.000000)\\"><g id =\\"Group\\" transform =\\"translate(24.000000, 56.000000)\\"><g id =\\"Group-2\\"><rect id =\\"Rectangle-5\\" x = { 25 } y = { 36 } width = { 48 } height = { 1 } />< / g></ g >< / g></ g >< / g></ g >< / svg > ;
13
13
}
14
14
15
15
export default SvgFile;
@@ -23,7 +23,12 @@ exports[`cli should support --prettier-config as file 1`] = `
23
23
24
24
function SvgFile(props) {
25
25
return (
26
- <svg width = { 48 } height = { 1 } { ... props } >
26
+ <svg
27
+ width = { 48 }
28
+ height = { 1 }
29
+ xmlns =\\"http://www.w3.org/2000/svg\\"
30
+ { ... props }
31
+ >
27
32
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
28
33
</svg >
29
34
)
@@ -39,7 +44,12 @@ exports[`cli should support --prettier-config as json 1`] = `
39
44
40
45
function SvgFile(props) {
41
46
return (
42
- <svg width = { 48 } height = { 1 } { ... props } >
47
+ <svg
48
+ width = { 48 }
49
+ height = { 1 }
50
+ xmlns =\\"http://www.w3.org/2000/svg\\"
51
+ { ... props }
52
+ >
43
53
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
44
54
</svg >
45
55
)
@@ -55,7 +65,7 @@ exports[`cli should support --svgo-config as file 1`] = `
55
65
56
66
function SvgFile(props) {
57
67
return (
58
- <svg width = { 48 } height = { 1 } { ... props } >
68
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
59
69
<title >{ ' Rectangle 5' } </title >
60
70
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
61
71
</svg >
@@ -72,7 +82,7 @@ exports[`cli should support --svgo-config as json 1`] = `
72
82
73
83
function SvgFile(props) {
74
84
return (
75
- <svg width = { 48 } height = { 1 } { ... props } >
85
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
76
86
<title >{ ' Rectangle 5' } </title >
77
87
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
78
88
</svg >
@@ -138,7 +148,7 @@ exports[`cli should support stdin filepath 1`] = `
138
148
139
149
function SvgFile(props) {
140
150
return (
141
- <svg width = { 48 } height = { 1 } { ... props } >
151
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
142
152
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
143
153
</svg >
144
154
)
@@ -154,7 +164,7 @@ exports[`cli should support various args: --expand-props none 1`] = `
154
164
155
165
function SvgFile() {
156
166
return (
157
- <svg width = { 48 } height = { 1 } >
167
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
158
168
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
159
169
< / svg >
160
170
)
@@ -170,7 +180,7 @@ exports[`cli should support various args: --expand-props start 1`] = `
170
180
171
181
function SvgFile(props) {
172
182
return (
173
- <svg { ... props } width = { 48 } height = { 1 } >
183
+ <svg { ... props } width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
174
184
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
175
185
< / svg >
176
186
)
@@ -186,7 +196,13 @@ exports[`cli should support various args: --icon 1`] = `
186
196
187
197
function SvgFile(props) {
188
198
return (
189
- <svg width =\\"1em\\" height =\\"1em\\" viewBox =\\"0 0 48 1\\" { ... props } >
199
+ <svg
200
+ width =\\"1em\\"
201
+ height =\\"1em\\"
202
+ viewBox =\\"0 0 48 1\\"
203
+ xmlns =\\"http://www.w3.org/2000/svg\\"
204
+ { ... props }
205
+ >
190
206
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
191
207
</svg >
192
208
)
@@ -203,7 +219,7 @@ import Svg, { Path } from 'react-native-svg'
203
219
204
220
function SvgFile() {
205
221
return (
206
- <Svg width = { 48 } height = { 1 } >
222
+ <Svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" >
207
223
<Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
208
224
< / Svg >
209
225
)
@@ -220,7 +236,13 @@ import Svg, { Path } from 'react-native-svg'
220
236
221
237
function SvgFile(props) {
222
238
return (
223
- <Svg width =\\"1em\\" height =\\"1em\\" viewBox =\\"0 0 48 1\\" { ... props } >
239
+ <Svg
240
+ width =\\"1em\\"
241
+ height =\\"1em\\"
242
+ viewBox =\\"0 0 48 1\\"
243
+ xmlns =\\"http://www.w3.org/2000/svg\\"
244
+ { ... props }
245
+ >
224
246
<Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
225
247
</Svg >
226
248
)
@@ -237,7 +259,13 @@ import Svg, { Path } from 'react-native-svg'
237
259
238
260
function SvgFile(props, svgRef) {
239
261
return (
240
- <Svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
262
+ <Svg
263
+ width = { 48 }
264
+ height = { 1 }
265
+ xmlns =\\"http://www.w3.org/2000/svg\\"
266
+ ref = { svgRef }
267
+ { ... props }
268
+ >
241
269
<Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
242
270
</Svg >
243
271
)
@@ -255,7 +283,7 @@ import Svg, { Path } from 'react-native-svg'
255
283
256
284
function SvgFile(props) {
257
285
return (
258
- <Svg width = { 48 } height = { 1 } { ... props } >
286
+ <Svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
259
287
<Path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
260
288
</Svg >
261
289
)
@@ -271,7 +299,7 @@ exports[`cli should support various args: --no-dimensions 1`] = `
271
299
272
300
function SvgFile(props) {
273
301
return (
274
- <svg viewBox =\\"0 0 48 1\\" { ... props } >
302
+ <svg viewBox =\\"0 0 48 1\\" xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
275
303
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
276
304
</svg >
277
305
)
@@ -286,7 +314,7 @@ exports[`cli should support various args: --no-prettier 1`] = `
286
314
"import * as React from \\ "react\\ ";
287
315
288
316
function SvgFile(props) {
289
- return <svg width = { 48 } height = { 1 } { ... props } ><path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" /></svg >;
317
+ return <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } ><path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" /></svg >;
290
318
}
291
319
292
320
export default SvgFile;
@@ -298,7 +326,14 @@ exports[`cli should support various args: --no-svgo 1`] = `
298
326
299
327
function SvgFile(props) {
300
328
return (
301
- <svg width =\\"48px\\" height =\\"1px\\" viewBox =\\"0 0 48 1\\" { ... props } >
329
+ <svg
330
+ width =\\"48px\\"
331
+ height =\\"1px\\"
332
+ viewBox =\\"0 0 48 1\\"
333
+ xmlns =\\"http://www.w3.org/2000/svg\\"
334
+ xmlnsXlink =\\"http://www.w3.org/1999/xlink\\"
335
+ { ... props }
336
+ >
302
337
<title >{ ' Rectangle 5' } </title >
303
338
<desc >{ ' Created with Sketch.' } </desc >
304
339
<defs />
@@ -339,7 +374,13 @@ exports[`cli should support various args: --ref 1`] = `
339
374
340
375
function SvgFile(props, svgRef) {
341
376
return (
342
- <svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
377
+ <svg
378
+ width = { 48 }
379
+ height = { 1 }
380
+ xmlns =\\"http://www.w3.org/2000/svg\\"
381
+ ref = { svgRef }
382
+ { ... props }
383
+ >
343
384
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
344
385
</svg >
345
386
)
@@ -356,7 +397,7 @@ exports[`cli should support various args: --replace-attr-values "#063855=current
356
397
357
398
function SvgFile(props) {
358
399
return (
359
- <svg width = { 48 } height = { 1 } { ... props } >
400
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
360
401
<path d =\\"M0 0h48v1H0z\\" fill =\\"currentColor\\" fillRule =\\"evenodd\\" />
361
402
</svg >
362
403
)
@@ -372,7 +413,14 @@ exports[`cli should support various args: --svg-props "hidden={true},id=hello" 1
372
413
373
414
function SvgFile(props) {
374
415
return (
375
- <svg width = { 48 } height = { 1 } hidden = { true } id =\\"hello\\" { ... props } >
416
+ <svg
417
+ width = { 48 }
418
+ height = { 1 }
419
+ xmlns =\\"http://www.w3.org/2000/svg\\"
420
+ hidden = { true }
421
+ id =\\"hello\\"
422
+ { ... props }
423
+ >
376
424
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
377
425
</svg >
378
426
)
@@ -388,7 +436,13 @@ exports[`cli should support various args: --title-prop 1`] = `
388
436
389
437
function SvgFile({ title , titleId , ... props } ) {
390
438
return (
391
- <svg width = { 48 } height = { 1 } aria-labelledby = { titleId } { ... props } >
439
+ <svg
440
+ width = { 48 }
441
+ height = { 1 }
442
+ xmlns =\\"http://www.w3.org/2000/svg\\"
443
+ aria-labelledby = { titleId }
444
+ { ... props }
445
+ >
392
446
{ title ? <title id = { titleId } >{ title } </title > : null }
393
447
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
394
448
</svg >
@@ -415,6 +469,7 @@ function SvgFile(
415
469
<svg
416
470
width = { 48 }
417
471
height = { 1 }
472
+ xmlns =\\"http://www.w3.org/2000/svg\\"
418
473
ref = { svgRef }
419
474
aria-labelledby = { titleId }
420
475
{ ... props }
@@ -439,7 +494,13 @@ function SvgFile(
439
494
svgRef?: React.Ref<SVGSVGElement >,
440
495
) {
441
496
return (
442
- <svg width = { 48 } height = { 1 } ref = { svgRef } { ... props } >
497
+ <svg
498
+ width = { 48 }
499
+ height = { 1 }
500
+ xmlns =\\"http://www.w3.org/2000/svg\\"
501
+ ref = { svgRef }
502
+ { ... props }
503
+ >
443
504
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
444
505
</svg >
445
506
)
@@ -456,7 +517,7 @@ exports[`cli should support various args: --typescript 1`] = `
456
517
457
518
function SvgFile(props: React.SVGProps<SVGSVGElement >) {
458
519
return (
459
- <svg width = { 48 } height = { 1 } { ... props } >
520
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
460
521
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
461
522
</svg >
462
523
)
@@ -512,7 +573,7 @@ exports[`cli should work with a simple file 1`] = `
512
573
513
574
function SvgFile(props) {
514
575
return (
515
- <svg width = { 48 } height = { 1 } { ... props } >
576
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
516
577
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
517
578
</svg >
518
579
)
@@ -528,7 +589,7 @@ exports[`cli should work with stdin 1`] = `
528
589
529
590
function SvgComponent(props) {
530
591
return (
531
- <svg width = { 48 } height = { 1 } { ... props } >
592
+ <svg width = { 48 } height = { 1 } xmlns =\\"http://www.w3.org/2000/svg\\" { ... props } >
532
593
<path d =\\"M0 0h48v1H0z\\" fill =\\"#063855\\" fillRule =\\"evenodd\\" />
533
594
</svg >
534
595
)
0 commit comments