diff --git a/packages/h2x-plugin-jsx/src/index.test.js b/packages/h2x-plugin-jsx/src/index.test.js index 6add5ef..b756f4c 100644 --- a/packages/h2x-plugin-jsx/src/index.test.js +++ b/packages/h2x-plugin-jsx/src/index.test.js @@ -21,7 +21,7 @@ describe('transformJsx', () => { expect(transform(code, { plugins: [transformJsx] }).trim()) .toBe(`{/*?xml version="1.0" encoding="UTF-8"?*/} - + {/*Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch*/} Dismiss diff --git a/packages/h2x-plugin-jsx/src/visitor.js b/packages/h2x-plugin-jsx/src/visitor.js index 7ffb767..2c26e5c 100644 --- a/packages/h2x-plugin-jsx/src/visitor.js +++ b/packages/h2x-plugin-jsx/src/visitor.js @@ -34,14 +34,13 @@ function hyphenToCamelCase(string) { function getAttributeName(attribute, node) { if ( !attribute.name.startsWith('aria-') && - !attribute.name.startsWith('data-') && - !attribute.name.includes(':') + !attribute.name.startsWith('data-') ) { return ( (ELEMENT_ATTRIBUTE_MAPPING[node.name] && ELEMENT_ATTRIBUTE_MAPPING[node.name][attribute.name]) || ATTRIBUTE_MAPPING[attribute.name] || - hyphenToCamelCase(attribute.name) + hyphenToCamelCase(attribute.name.replace(':', '-')) ) }