Skip to content

Commit 086f3f7

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 a2139ac commit 086f3f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ function parseNode(types, node) {
296296
if (type === "JSXText") {
297297
const trimmed = node.value.trim();
298298
if (!trimmed) return null;
299-
return types.stringLiteral(trimmed);
299+
// Preserve original text if it contains non-whitespace
300+
// This maintains intentional spacing like "Hello " in <span>Hello </span>
301+
return types.stringLiteral(node.value);
300302
}
301303

302304
if (type === "JSXElement") {

0 commit comments

Comments
 (0)