Skip to content

Conversation

AhyoungRyu
Copy link
Contributor

Fixes the issue https://sendbird.atlassian.net/browse/CLNP-4962
where HTML entities like &sect or &lt were being automatically converted to their corresponding symbols (§ or >) when pasting content into a contentEditable element.

Changes

The document.execCommand('insertHTML', false, sanitizeString(text)) command was replaced with document.execCommand('insertText', false, sanitizeString(text)).
This change ensures that HTML entities are inserted as plain text rather than being interpreted and converted by the browser. Now it prevents unintended conversion of HTML entities, maintaining the original text as expected when pasting content.

How to test?

Try this on the preview.
Type &sect and copy & paste the text to the input box. The exact same text(=&sect) should be on the input not §.

Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit be5ba1c
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/66cde29083d3e70008ab3778
😎 Deploy Preview https://deploy-preview-1208--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@HoonBaek HoonBaek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HoonBaek
Copy link
Contributor

Isn't it 3.14.15?

@AhyoungRyu
Copy link
Contributor Author

No no the next release will be 3.15.0 https://sendbird.slack.com/archives/G01290GCDCN/p1724658756997849

@AhyoungRyu AhyoungRyu merged commit 7192bac into main Aug 28, 2024
9 checks passed
@AhyoungRyu AhyoungRyu deleted the fix/CLNP-4962 branch August 28, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants