如何将 tinymce 初始化为纯文本编辑器

How to initialize tinymce as plain-text editor

我想使用 tinymce 编辑器来可视化像这样的段落这样的特殊字符:¶ 它应该只可视化它。输入的值应该只包含纯文本。 是否有设置参数强制 tinymce 在纯文本模式下工作?

您可以从 TinyMCE 编辑器中以 HTML 或纯文本形式检索内容。要以纯文本形式检索内容,请在获取内容时指定 format: 'text'。例如:

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

有关 getContent 的更多信息,请参阅:https://www.tiny.cloud/docs/api/tinymce/tinymce.editor/#getcontent