We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be535c4 commit 577124cCopy full SHA for 577124c
utils/custom-loaders/html-tag-jsx-loader.js
@@ -21,11 +21,9 @@ module.exports = function htmlTagJsxLoader(source) {
21
const isTypeScript = /\.tsx?$/.test(this.resourcePath);
22
23
// 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);
+ // Look for complete JSX opening tags with proper spacing
+ const hasJSXLike = /<[A-Z][a-zA-Z0-9]*(?:\s|\/?>)|<[a-z]+(?:\s|\/?>)/.test(source);
26
if (!hasJSXLike) {
27
- return callback(null, source);
28
- }
29
30
// Parse with appropriate plugins
31
const parserPlugins = ["jsx"];
0 commit comments