Skip to content

Commit 29a7fb8

Browse files
authored
Merge pull request #92 from developit/jsx-leading-underscore
jsx-to-htm: leading underscore = reference tag
2 parents c5764b5 + e269304 commit 29a7fb8

File tree

1 file changed

+2
-2
lines changed
  • packages/babel-plugin-transform-jsx-to-htm

1 file changed

+2
-2
lines changed

packages/babel-plugin-transform-jsx-to-htm/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
119119
}
120120

121121
if (!isFragment) {
122-
if (name.match(/^[A-Z]/)) {
122+
if (name.match(/(^[$_A-Z]|\.)/)) {
123123
raw('</');
124124
expr(t.identifier(name));
125125
raw('>');
@@ -142,7 +142,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
142142
const isFragment = name === 'React.Fragment';
143143

144144
if (!isFragment) {
145-
if (name.match(/^[A-Z]/)) {
145+
if (name.match(/(^[$_A-Z]|\.)/)) {
146146
raw('<');
147147
expr(t.identifier(name));
148148
}

0 commit comments

Comments
 (0)