strapi / blocks-react-renderer

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

[feat]: Replace   with non-breaking space #48

Open scriptoriumwebdev opened 2 months ago

scriptoriumwebdev commented 2 months ago

A clear and concise description of what the feature is

This feature replaces all the incidences of   found in this codebase with regular non-breaking space

Why should this feature be included?

Improved readability. This feature woud make the text more readable.

Please provide an example for how this would work

transform:

<p>This&nbsp;is&nbsp;a&nbsp;test&nbsp;sentence.</p>

with

.replace(/&nbsp;/g, " ")

or

.replace(/&nbsp;/g, "\u00A0")

to:

<p>This is a test sentence.</p>