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

An optional and empty editor still stores some content #271

Open
kevinrenskers opened this issue Nov 20, 2024 · 1 comment
Open

An optional and empty editor still stores some content #271

kevinrenskers opened this issue Nov 20, 2024 · 1 comment

Comments

@kevinrenskers
Copy link

When I have an optional editor field in my model, for example body = CKEditor5Field(blank=True), then saving the form without filling any content into the text editor still stores <p>&nbsp;</p> as its content. So that means if I then check if there is content (if self.body), this will always say that there is content.

It means I now manually have to trim <p>&nbsp;</p> from the content before making this check, or before storing the content. Why is the editor storing this empty paragraph when no content has been entered?

@goapunk
Copy link
Contributor

goapunk commented Dec 4, 2024

Hi @kevinrenskers as far as I remember ckeditor5 always add as empty paragraph, there's no way to prevent that. We could probably add a check somewhere to remove the empty paragraph though.

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

No branches or pull requests

2 participants