Skip to content

[feat]: Support for Interpreting \n as Line Breaks  #37

Closed
@ringm

Description

@ringm

A clear and concise description of what the feature is

It would be incredibly helpful if blocks-react-renderer could support interpreting \n characters as line breaks in text strings.

Why should this feature be included?

This feature is essential for rendering multiline text more intuitively, especially when dealing with user-generated content or preformatted text blocks. This lack of line break support necessitates additional string manipulation and mapping in the component code, which complicates the rendering process and adds extra overhead.

Please provide an example for how this would work

Currently, when a text string containing \n characters is rendered, the \n characters are not converted into HTML line breaks (
). For example, a text string like "This is a heading and \n\n I want this to be on a new line" is rendered as a single continuous line rather than as:

This is a heading and
I want this to be on a new line

Handling line breaks natively in blocks-react-renderer aligns with common text rendering practices and enhances the library's usability in more diverse text formatting scenarios.

Thank you for considering this feature request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: enhancementIssue suggesting an enhancement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions