Adds a Sentence Length toolbar button that analyzes sentence length distribution and highlights sentences in the editor by category (short, optimal, medium, long, too long).
Opens a chart panel with percentage bars. Highlights are stripped on export via output:before:html.
<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/sentence-length/sentence-length.js"></script>
const app = Redactor('#entry', {
plugins: ['sentenceLength']
});
| Label | Key | Word count |
|---|---|---|
| 1–8 | short |
≤ 8 |
| 9–15 | optimal |
≤ 15 |
| 16–22 | medium |
≤ 22 |
| 23–30 | long |
≤ 30 |
| 31+ | tooLong |
> 30 |