TinyMCE 4 - 普通 text/strip HTML 标签按钮

TinyMCE 4 - Plain text/strip HTML tags button

有没有办法完全去除所选元素的样式和 HTML 标签?

所以 <p>Text</p> 会变成 Text

在格式下拉列表中使用自定义按钮(功能)还是 'Plain Text' 样式?

尝试

selection.getContent({格式:'text'});

selection.getContent({格式:'html'});

感谢 Anub 的指导,我自己设法做到了。

// Store the current selections string/value in a variable and strip it's tags
var node = tinymce.activeEditor.selection.getContent({ format : 'text' });

// Replace the selected content with the stripped out content
tinymce.activeEditor.selection.setContent(node);