blocks-react-renderer
blocks-react-renderer copied to clipboard
fix: handle line breaks
What does it do?
Transforms \n, \r\n and \r into <br /> tags in <Text />
Why is it needed?
Fixes https://github.com/strapi/blocks-react-renderer/issues/37
How to test it?
- Create rich text blocks with line returns in them (⇧+⏎ in the rich text editor)
- Render them with
<BlocksRenderer /> - Make sure the newline characters are replaced by
<br />tags
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
@remidej Could you take a look into this :shipit: ?