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

Suneditor crash when assigning a default value #828

Closed
gopal1996 opened this issue Jul 26, 2021 · 3 comments
Closed

Suneditor crash when assigning a default value #828

gopal1996 opened this issue Jul 26, 2021 · 3 comments
Labels
Milestone

Comments

@gopal1996
Copy link

Describe the bug
when assigning a default value to suneditor with specific tag, suneditor gets crashed

To Reproduce
Steps to reproduce the behavior:

  1. set value to <figure style="margin: auto; width: 490px;"><img class="se-custom-tag" src="https://1.bp.blogspot.com/-mhdYXV7RykU/Xls3b-1qM1I/AAAAAAAAnqM/ke6nHNve0twL_s-uNcAuI4tMf8y0VEDYQCLcBGAsYHQ/s1600/Happy-birthday-messages-and-Happy-birthday-wishes%2B%25281%2529-min.jpg" alt="" data-proportion="true" data-size="490px,490px" data-align="justify" data-index="3" data-file-name="Happy-birthday-messages-and-Happy-birthday-wishes%2B%25281%2529-min.jpg" data-file-size="0" origin-size="500,500" data-origin="490px,490px" style="width: 490px; height: 490px;"></figure>
  2. suneditor gets crashed

Expected behavior
it should load the content with an image in the editor

Screenshots
image

Codesandbox
https://codesandbox.io/s/suneditor-8exq4?file=/src/App.js

Desktop (please complete the following information):

  • OS: Macos Big sur
  • Browser : Chrome
  • Version : 91
@JiHong88 JiHong88 added the bug label Jul 27, 2021
@JiHong88 JiHong88 added this to the 2.42.0 milestone Jul 27, 2021
@JiHong88
Copy link
Owner

Did you manually edit the tag attributes?
The cause of the error is the "data-align" attribute.
data-align="justify" => data-align="center"
It will be added exception handling at the next version.

@gopal1996
Copy link
Author

gopal1996 commented Jul 27, 2021

not sure how it was added, but we are inserting the image using insertHTML function with <img src="..." />.
Thanks a lot

@JiHong88
Copy link
Owner

The 2.42.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

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

No branches or pull requests

2 participants