Skip to content

Commit 577124c

Browse files
Update utils/custom-loaders/html-tag-jsx-loader.js
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent be535c4 commit 577124c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

utils/custom-loaders/html-tag-jsx-loader.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ module.exports = function htmlTagJsxLoader(source) {
2121
const isTypeScript = /\.tsx?$/.test(this.resourcePath);
2222

2323
// Quick check: if no JSX syntax at all, pass through unchanged
24-
// Look for JSX opening tags: < followed by a letter or uppercase
25-
const hasJSXLike = /<[A-Z][\w]*[\s/>]|<[a-z]+[\s\/>]/.test(source);
24+
// Look for complete JSX opening tags with proper spacing
25+
const hasJSXLike = /<[A-Z][a-zA-Z0-9]*(?:\s|\/?>)|<[a-z]+(?:\s|\/?>)/.test(source);
2626
if (!hasJSXLike) {
27-
return callback(null, source);
28-
}
2927

3028
// Parse with appropriate plugins
3129
const parserPlugins = ["jsx"];

0 commit comments

Comments
 (0)