Skip to content

Commit

Permalink
Merge branch 'master' into fix/esm-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert authored Mar 4, 2024
2 parents 4ccf292 + 982b21b commit 4851be4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ Array [
exports[`preserveWhitespace preserves spaces between words 1`] = `
Array [
<p>
hello&nbsp;&nbsp;&nbsp;&nbsp;world
hello    world
</p>,
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function nodeToReactComponent(node: CommonNode, options: Options): ReactN

if (preserveWhitespace) {
// Preserve multiple spaces.
nodeValue = (nodeValue as string).replace(/ {2,}/g, (match) => '&nbsp;'.repeat(match.length));
nodeValue = (nodeValue as string).replace(/ {2,}/g, (match) => '\u00A0'.repeat(match.length));

// Preserve line breaks.
let lines = (nodeValue as string).split('\n');
Expand Down

0 comments on commit 4851be4

Please sign in to comment.