How to initialize tinymce as plain-text editor

1.7k Views Asked by At

I want to use the tinymce editor for visualizing special chars like a paragraph like this: ¶ It should only visualize it. The value of the input should contain only plain text. Is there a setup param to force tinymce to work in plain text mode?

1

There are 1 best solutions below

1
Ben Long On BEST ANSWER

You can retrieve content from the TinyMCE editor as HTML or plaintext. To retrieve the content as plaintext specify format: 'text' when you get the content. For example:

// Get the contents of the currently active editor as plain text
tinymce.activeEditor.getContent({format: 'text'});

For more information about getContent, see: https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#getcontent.