strapi / blocks-react-renderer

A React renderer for the Strapi's Blocks rich text editor
Other
107 stars 15 forks source link

[feat]: The blocks-react-renderer npm package is used to render the content configured in the Rich text (Blocks) rich text edit box. Only the content has no format. #9

Closed happlybears-Leonard closed 7 months ago

happlybears-Leonard commented 8 months ago

A clear and concise description of what the feature is

Hello, I am trying to use strapi to provide interface services to the front-end application in the content management backend.

The Rich text (Blocks) component of the strapi cms content management backend is configured with a rich text editing box. After editing the content in Rich text (Blocks), how can the front-end webpage obtain the data through the interface and restore it to a 1:1 ratio?

I used the blocks-react-renderer npm package, but only the content has no format. I hope that after writing the formatted content in Rich text (Blocks) in the strapi cms content management backend, the front-end interface requests the corresponding content and inserts it directly. , the displayed content and style can be consistent with those during editing, without the front-end website having to handle it by itself. This is too cumbersome and not open source enough.

Why should this feature be included?

It is expected that after writing the formatted content in the rich text (Blocks) of the strapi cms content management backend, the front-end interface requests the corresponding content and inserts it directly. The displayed content and style can be consistent with those during editing, without the need for a front-end It would be too cumbersome for the website to handle it on its own and not open source enough.

Please provide an example for how this would work

No response

remidej commented 7 months ago

Hello, thanks for filing this issue. I understand your point, but the current behavior is what we actually want, and we're not going to change it.

The goal of this renderer is to help developers with the logic to parse the Strapi Blocks format. We want the default experience to work, so that you can view your content, but we're not making any design decisions on purpose. Because:

Ideally we want users to define their own design by providing their components. If you don't want to do that, but also would like something a little prettier than raw HTML, I would recommend using Tailwind's Typography package, which basically makes raw HTML look good.