Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copied text into PB paragraph element not visible #2563

Open
plsalvado opened this issue Aug 2, 2022 · 0 comments
Open

Copied text into PB paragraph element not visible #2563

plsalvado opened this issue Aug 2, 2022 · 0 comments

Comments

@plsalvado
Copy link

Version

5.29.0

Operating System

macOS

Browser

Chrome

What are the steps to reproduce this bug?

  1. Create a page with a paragraph element
  2. Go to this page - as an example - and copy the text at the top "Our mission is to organise the world’s information and make it universally accessible and useful." You need to copy it from the website itself.
  3. Paste that text into the paragraph element.

What is the expected behavior?

When the page is published the text should be rendered.

What do you see instead?

A few important things to note:

  1. The page renders OK in preview mode,
  2. The paragraph is not rendered when the page is published. Reasons why below.

The copied text contains some HTML encoded tags which are not being sanitised at the time of pasting the content into PB. See in the Additional Information section how the text attribute contains an HTML encoded p tag, which breaks the rendering of the published page.

Additional information

"elements": [{
    "id": "WCKfnhSUCi",
    "type": "paragraph",
    "data": {
        "text": {
            "desktop": {
                "type": "paragraph",
                "typography": "webiny-pb-typography-body",
                "alignment": "left",
                "tag": "p"
            },
            "data": {
                "text": "\u003cp>Our mission is to organise the world’s information and make it universally accessible and useful.\u003c/p>"
            }
        },
        "settings": {
            "margin": {
                "desktop": {
                    "all": "0px"
                }
            },
            "padding": {
                "desktop": {
                    "all": "0px"
                }
            }
        }
    },
    "elements": [],
    "path": ["aoOvCNMuES", "lHbpgj5NuK",
        "sneNOpuOCI"
    ]
}],
"path": ["aoOvCNMuES", "lHbpgj5NuK", "sneNOpuOCI"]

Possible solution

Sanitise the text at the time of pasting into the element.

Another important note, this is not happening with the Heading element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants