Skip to content

Commit 614d89d

Browse files
author
Konstantinos Bairaktaris
committed
Fix small inconsistencies in source strings
1 parent 7e218f8 commit 614d89d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/cli/src/api/parsers/babel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function toStr(children, counter = 0) {
7373
}
7474
} else if (child.type === 'JSXText') {
7575
// Child is not a React element, append as-is
76-
const chunk = child.value.trim();
76+
const chunk = child.value.trim().replace(/\s+/g, ' ');
7777
if (chunk) { result.push(chunk); }
7878
} else if (
7979
child.type === 'JSXExpressionContainer'

packages/react/src/utils/toStr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function toStr(children, counter = 0) {
6464
// Child is not a React element, append as-is
6565
/* eslint-disable no-lonely-if */
6666
if (typeof child === 'string' || child instanceof String) {
67-
const chunk = child.trim();
67+
const chunk = child.trim().replace(/\s+/g, ' ');
6868
if (chunk) { result.push(chunk); }
6969
} else {
7070
result.push(child);

0 commit comments

Comments
 (0)