Closed
Description
If I start with this JSX:
<div>
foo <strong>bar</strong> baz
</div>
That renders to React element that with children like this:
[
'foo ',
{ type: 'strong', props: { children: [Object] }, .. },
' baz'
]
If I then pass that element through this module, I come out with this JSX — replacing some whitespaces with *
to clarify:
<div>
foo*
<strong>
bar
</strong>
*baz
</div>
The problem is that with the reformatting, those whitespace are actually lost. End-of-line and beginning-of-line whitespace is not meaningful, so the output HTML is actually this:
<div>
foo<strong>bar</strong>baz
</div>
If introducing all the line breaks is the preference here, I think one fix would be to add spaces as strings, e.g.
<div>
foo{' '}
<strong>
bar
</strong>
{' '}baz
</div>
Metadata
Metadata
Assignees
Labels
No labels