Closed CharuGoyalS closed 3 months ago
I've got the same problem. I applied a limit of 60 characters, but as you can see, it exceeds 60. It's just a highlight; it can still be saved without an error.
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.
Please check this again as- it is not word count, we are setting Maximum length means it is supposed to show some error if the length is increasing. Same is working correctly in Strapi's default markdown editor and other fields.
@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.