-
Notifications
You must be signed in to change notification settings - Fork 57
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
Character limit not working #150
Comments
The Word count and character count feature by default is not supposed to do anything but count. If you want any special behavior, you can customize the plugin to your needs or create a feature or PR request. |
@CharuGoyalS In short, it highlights the counter in red when you exceed the limit, and mimicking the default behavior is not currently possible due to Strapi's validation logic. There was no good way to mimic the default behavior before. I checked again, and there is nothing new in that direction. The problem lies in the way Strapi validates the editor's output. It measures the string length directly, which works for the default Markdown editor, but in the case of CKEditor, we have a string containing HTML syntax, and elements like tags shouldn't be counted when measuring it. It is possible to manually output an error bypassing Strapi's error logic, but preventing the save action is not an easy task. So, I went with just highlighting the counter in red. Some thoughts:
If you have any good ideas, I would be eager to hear them. @crfts-tun I think you mixed up the repo. Based on your screenshot, it looks like you are using the official plugin. |
apply character limit of 5000 to ckEditor.
Expected Result : it should not allow more than 5000 characters.
Actual Result : it is accepting more than 5000 characters.
The text was updated successfully, but these errors were encountered: