Skip to content

Commit

Permalink
editor: Add word count plugin to RichEditor toolbar
Browse files Browse the repository at this point in the history
* This is useful when the input field has a character limit, allowing users to see the current character count.
* Related to inveniosoftware/invenio-requests#391
  • Loading branch information
Samk13 committed Jul 4, 2024
1 parent 6cde34d commit c512f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/forms/RichEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "tinymce/plugins/autoresize";
import "tinymce/plugins/codesample";
import "tinymce/plugins/link";
import "tinymce/plugins/lists";
import "tinymce/plugins/wordcount";
import PropTypes from "prop-types";

export class RichEditor extends Component {
Expand All @@ -27,10 +28,10 @@ export class RichEditor extends Component {
statusbar: false,
min_height: minHeight,
content_style: "body { font-size: 14px; }",
plugins: ["codesample", "link", "lists", "table", "autoresize"],
plugins: ["codesample", "link", "lists", "table", "autoresize", "wordcount"],
contextmenu: false,
toolbar:
"blocks | bold italic link codesample blockquote table | bullist numlist | outdent indent | undo redo",
"blocks | bold italic link codesample blockquote table | bullist numlist | outdent indent | wordcount | undo redo",
autoresize_bottom_margin: 20,
block_formats: "Paragraph=p; Header 1=h1; Header 2=h2; Header 3=h3",
table_advtab: false,
Expand Down

0 comments on commit c512f0e

Please sign in to comment.