1.4 KiB
1.4 KiB
layout, title, title_nav, description, keywords
| layout | title | title_nav | description | keywords |
|---|---|---|---|---|
| default | Word Count Plugin | Word Count | Show a word count in the TinyMCE status bar. | wordcount wordcount_cleanregex wordcount_countregex |
This plugin adds word count functionality to TinyMCE, placing a counter on the right edge of the status bar.
Type: String
Example
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "wordcount"
});
Options
These settings affect the execution of the wordcount plugin. The regular expression values that determine how words are cleaned and counted may be set here.
wordcount_cleanregex
This option allows you to specify the regular expression that will be used to strip punctuation and numbers from the word count. Removed in 4.5.0
Type: String
Example
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "wordcount",
wordcount_cleanregex: /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g
});
wordcount_countregex
This option allows you to specify the regular expression that will be used to count the words for the word count. Removed in 4.5.0
Type: String
Example
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "wordcount",
wordcount_countregex: /[\w\u2019\x27\-\u00C0-\u1FFF]+/g
});