blocks-react-renderer icon indicating copy to clipboard operation
blocks-react-renderer copied to clipboard

fix: handle line breaks

Open r-o-b-o-t-o opened this issue 1 year ago • 1 comments

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

r-o-b-o-t-o avatar Jul 05 '24 18:07 r-o-b-o-t-o

This worked perfectly for me, thanks!

leelawtondesign avatar Aug 13 '24 19:08 leelawtondesign

It would be nice to merge :)

antoine-roux avatar Oct 20 '24 15:10 antoine-roux

we need this in production pack! that would be nice.

pbozyk avatar Oct 25 '24 19:10 pbozyk

In the meantime, my fork is available on npm: @roboto_/strapi-blocks-react

r-o-b-o-t-o avatar Oct 28 '24 07:10 r-o-b-o-t-o

@remidej Could you take a look into this :shipit: ?

KasperiP avatar Jan 15 '25 21:01 KasperiP