Skip to content

Commit

Permalink
Fix small inconsistencies in source strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kbairak committed Nov 21, 2022
1 parent 19e792b commit a4e87be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/api/parsers/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function toStr(children, counter = 0) {
}
} else if (child.type === 'JSXText') {
// Child is not a React element, append as-is
const chunk = child.value.trim();
const chunk = child.value.trim().replace(/\s+/g, ' ');
if (chunk) { result.push(chunk); }
} else if (
child.type === 'JSXExpressionContainer'
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/utils/toStr.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function toStr(children, counter = 0) {
// Child is not a React element, append as-is
/* eslint-disable no-lonely-if */
if (typeof child === 'string' || child instanceof String) {
const chunk = child.trim();
const chunk = child.trim().replace(/\s+/g, ' ');
if (chunk) { result.push(chunk); }
} else {
result.push(child);
Expand Down

0 comments on commit a4e87be

Please sign in to comment.