Skip to content

Commit 8d7d13a

Browse files
committed
fix(compiler): preserve HTML entities in JSX text by correctly detecting non-empty lines
1 parent c80a075 commit 8d7d13a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • compiler/packages/babel-plugin-react-compiler/src/HIR

compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,7 @@ function trimJsxText(original: string): string | null {
35633563
let lastNonEmptyLine = 0;
35643564

35653565
for (let i = 0; i < lines.length; i++) {
3566-
if (lines[i].match(/[^ \t]/)) {
3566+
if (lines[i].trim().length > 0) {
35673567
lastNonEmptyLine = i;
35683568
}
35693569
}

0 commit comments

Comments
 (0)