This repository was archived by the owner on Aug 24, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/h2x-plugin-jsx/src Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -101,4 +101,11 @@ describe('transformJsx', () => {
101
101
`<div id="foo" style={{"fontSize":10,"lineHeight":1.2}} />` ,
102
102
)
103
103
} )
104
+
105
+ it ( 'should handle special SVG attributes' , ( ) => {
106
+ const code = `<svg autoReverse="false" externalResourcesRequired="true" focusable="true" preserveAlpha="false"></svg>`
107
+ expect ( transform ( code , { plugins : [ transformJsx ] } ) . trim ( ) ) . toBe (
108
+ '<svg autoReverse="false" externalResourcesRequired="true" focusable="true" preserveAlpha="false" />' ,
109
+ )
110
+ } )
104
111
} )
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { isNumeric, hyphenToCamelCase } from './util'
7
7
const ATTRIBUTE_MAPPING = {
8
8
for : 'htmlFor' ,
9
9
class : 'className' ,
10
+ autoreverse : 'autoReverse' ,
11
+ externalresourcesrequired : 'externalResourcesRequired' ,
10
12
}
11
13
12
14
const ELEMENT_ATTRIBUTE_MAPPING = {
@@ -155,7 +157,6 @@ export default {
155
157
HTMLElement : {
156
158
enter ( path ) {
157
159
const jsxElement = new JSXElement ( )
158
-
159
160
jsxElement . name = transformTagName ( path . node . tagName )
160
161
jsxElement . attributes = listToArray ( path . node . attributes )
161
162
jsxElement . children = listToArray ( path . node . childNodes )
You can’t perform that action at this time.
0 commit comments