-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle line breaks #42
base: main
Are you sure you want to change the base?
Conversation
This worked perfectly for me, thanks! |
It would be nice to merge :) |
we need this in production pack! that would be nice. |
In the meantime, my fork is available on npm: @roboto_/strapi-blocks-react |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, could you just add a unit test too?
And sorry I wasn't aware of this PR, it's been a while so if you don't want to get back to it we can make another PR internally
<React.Fragment key={idx}> | ||
{!!idx && <br />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!idx
isn't very readable, could you instead check if it's > 0
?
What does it do?
Transforms
\n
,\r\n
and\r
into<br />
tags in<Text />
Why is it needed?
Fixes #37
How to test it?
<BlocksRenderer />
<br />
tags