dhtmlxRichText 1.1: API to Work with Text, Block Quotes, and Advanced Statistics

A recently launched dhtmlxRichText, JavaScript rich text editor, receives its first minor update v1.1 with expanded functionality. We’ve provided developers with an easy and convenient way to work with content instantly via the editor’s API. The release also brings out a new toolbar block quote control for adding text quotes, an ability to serialize content into plain text, and advanced statistics for counting the number of characters, words and other text elements.

Working With Rich Text Editor API

Starting with v1.1 developers gain access to the API of our JavaScript rich text editor that enables them to work with the text directly. Using the getEditorAPI() method you will get all the available methods for text processing such as adding a new text into the editor, styling it, adding a data model or returning it in the JSON format.

For example, the update() method helps you to change the style of a text, e.g. apply a new style to it:

The number of all counted elements can be displayed together or separately, depending on the needs of end users.

Showing the number of characters including spaces in a text:

var chars = richtext.getStats().chars;

Showing the number of words in a text:

var chars = richtext.getStats().words;

Showing the number of characters without spaces in a text:

var chars = richtext.getStats().charsExlSpace;

You can also determine where and how to display the numbers counted by RichText. For instance, the editor may show these statistics in a separate container after an end user clicks on a button.

However, the abilities of RichText are not limited to counting just words and characters. With the help of the customStatsconfiguration property you can get any statistical characteristics you need (for example, a number of sentences):

Other Enhancements

Apart from new features, our dev team made a couple of improvements in the existing functionality. Among the most essential updates is support for the Asian languages. You can find the whole list in our docs.

Hope you’ll enjoy the update and find the newly added features useful for your applications! In any case, we invite you to share your ideas and feedback in our 1-minute survey. Also, feel free to leave your comments below!

If you’re interested in our plans for future development of rich text editor, consult its public roadmap and influence the development by voting for your preferred functionality.

Current clients will find a download link for the updated version in their Client’s Area.