webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.35k stars 606 forks source link

Issues with Quotes (rich text content type) #2446

Open larissa-n opened 2 years ago

larissa-n commented 2 years ago

Version

Most recent

Operating System

Any

Browser

Any

What steps will reproduce the bug?

Using Headless CMS & @webiny/react-rich-text-renderer Docs: https://www.webiny.com/docs/headless-cms/extending/render-rich-text-content

What is the expected behavior?

Quote text should be rendered as it was provided, including special characters

What do you see instead?

& is rendered as &amp; Carriage returns are rendered as <br>

Captions are not shown, but that is to be expected from default render function.

function renderQuote(block: OutputBlockData) {
    return (
        <blockquote className={"rte-block-blockquote"}>
            <p>{block.data.text}</p>
        </blockquote>
    );
}

Additional information

No response

Possible solution

No response

jimjoes commented 2 years ago

+1 The rich text renderer also does this with lists.

Pavel910 commented 2 years ago

You can, for the time being, bypass the issue by providing your own renderer: https://github.com/webiny/webiny-js/tree/next/packages/react-rich-text-renderer#adding-custom-renderers

If you do implement your own renderer, please share your implementation with us, or even better, open a PR that fixes these issues.