Allow set chars or words limit
Jodit.make('#editor', { /** * limit words count */ limitWords: 100, /** * limit chars count */ limitChars: 400, /** * limit html chars count */ limitHTML: true});
limitWords
limitChars
limitHTML
When limits are reached, a series of events occur:
limit.limit
denyChars.limit
denyWords.limit
denyPaste.limit
const jodit = Jodit.make('#editor', { limitWords: 100});jodit.e.on( 'limit.limit', jodit.async.debounce(() => { // Allow 'error' | 'info' | 'success' See error-messages plugin editor.e.fire('errorMessage', 'Limit reached!', 'error'); return false; }, 300));
If you like Jodit - try Jodit PRO
Set editing limit
Allow set chars or words limit
limitWords
- Limits the number of words separated by spaces. Limitation does not include HTML tags and attributeslimitChars
- Limits the number of characters not including spaces and special characters. Tags and attributes are also ignored.limitHTML
- If this option is enabled, thenlimitWords
andlimitChars
count tags and their attributes.Events
When limits are reached, a series of events occur:
limit.limit
- Upon reaching any of the limitsdenyChars.limit
- When the character limit is reacheddenyWords.limit
- Upon reaching any wordsdenyPaste.limit
- If the user wanted to insert text beyond the limits